Space-time attention and optical flow constrained video generation method and system
By employing a video generation method constrained by spatiotemporal attention and optical flow, the problems of inter-frame jitter and long-range motion breaks are solved, hardware costs are reduced, and generation efficiency and video quality are improved.
Patent Information
- Application Number
- CN202511190216.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-25
- Publication Date
- 2025-12-16
AI Technical Summary
Existing video generation technologies suffer from significant inter-frame jitter, long-range motion breaks, and high hardware costs, mainly due to the lack of temporal coherence caused by independent frame-by-frame generation and the absence of optical flow constraints in the generation process.
A video generation method constrained by spatiotemporal attention and optical flow is adopted. Feature extraction is performed through spatiotemporal attention U-Net, combined with optical flow prediction and dynamic path optimization. Motion-aware cross-frame attention and sparsification processing are utilized, and the generation time continuity of Perlin noise and Brownian motion noise is combined to perform optical flow residual compensation and noise-semantic joint modulation, thereby realizing camera motion path optimization in four-dimensional state space.
It effectively reduces inter-frame jitter, improves the physical plausibility of motion and generation efficiency, reduces hardware costs, and achieves high-quality video generation.
Smart Images

Figure CN121151647A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video generation technology, specifically a video generation method and system constrained by spatiotemporal attention and optical flow. Background Technology
[0002] Currently, mainstream video generation technologies primarily employ frame-by-frame diffusion models, such as AnimateDiff and Sora. Their core idea is to apply the diffusion process to each frame of the video sequence while attempting to maintain temporal continuity and content consistency between frames through specific mechanisms. The final video is synthesized by concatenating the results of individual frames. However, these existing technologies have significant drawbacks, including noticeable inter-frame jitter (PSNR fluctuations of 2.1-3.5 dB), a tendency for long-range motion to break up due to the lack of consideration for physical motion continuity in cross-frame attention, and high hardware costs (requiring 24GB of VRAM for a single 1080P frame, such as an RTX 4090). These shortcomings stem from the lack of temporal coherence caused by independent frame-by-frame generation, the fact that optical flow constraints are only used as a post-processing module and not embedded in the generation process, and insufficient spatiotemporal joint modeling, merely expanding 2D convolutions into pseudo-3D.
[0003] Therefore, in view of the above situation, there is an urgent need to develop a video generation method and system with spatiotemporal attention and optical flow constraints to overcome the shortcomings in current practical applications. Summary of the Invention
[0004] The purpose of this invention is to provide a video generation method and system constrained by spatiotemporal attention and optical flow to solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the present invention provides the following technical solution: A video generation method constrained by spatiotemporal attention and optical flow includes the following steps: (1) The input text is mapped to a visual semantic vector by a text encoder; (2) Based on the visual semantic vector, generate a temporally coherent multi-frame latent noise tensor; (3) The potential noise tensors of the multi-frame video are feature extracted by spatiotemporal attention U-Net to generate an initial video frame sequence; The spatiotemporal attention U-Net performs the following: Motion-aware cross-frame attention calculation: Using the optical flow field deformation key matrix and value matrix, global attention calculation is performed only on the first 10% of the motion amplitude region; Sparsity processing: The video is divided into a sliding window of 32 frames, with an overlap rate of 50% between adjacent windows, and global attention is calculated only for the top 10% of the regions with the largest motion amplitude.
[0006] As a further aspect of the present invention: step (1) specifically includes: Text features were extracted using a visual-text dual-tower encoder. The 768-dimensional features are mapped to 1024 dimensions using a cross-modal projection head; Modifiers in the input text are dynamically expanded using GPT-4 Turbo.
[0007] As a further aspect of the present invention: step (2) specifically includes: Perlin noise is used to generate spatially continuous noise, and Brownian motion noise is combined to generate temporally continuous noise; The noise attenuation curve is controlled by stochastic differential equations (SDEs). Visual semantic vectors are injected into the noise generation process to make the noise similarity between adjacent frames >0.85.
[0008] As a further aspect of the present invention: the video generation method further includes an optical flow constraint step: (4) Perform dual-path optical flow prediction on the initial video frame sequence: Forward path: Predicts the pixel displacement field from the current frame to the next frame; Reverse path: Calculate the compensation field from the next frame to the current frame; (5) Optimize motion trajectory through optical flow residual compensation: ; in, This represents the weighting coefficient for the forward optical flow loss term; These are the weighting coefficients for the forward and backward consistency loss term; The forward optical flow field predicted by the model; For a true forward optical flow field; The phototropic flow field predicted by the model; is the identity transformation matrix; ∘ represents the field composition operation.
[0009] As a further aspect of the present invention: step (4) specifically includes: Five-level pyramid optical flow estimation was performed at 1 / 8 to 1 resolution. An LSTM-assisted iterative correction mechanism was used to optimize the process three times. A Kalman filter is used for trajectory smoothing, with a process noise covariance Q=0.01 and an observation noise covariance R=0.1.
[0010] As a further aspect of the present invention: step (3) further includes noise-semantic joint modulation: Establish an inter-frame noise correlation matrix, wherein the correlation coefficient of the matrix is greater than 0.9; Dynamically adjust the noise reduction intensity based on CLIP vector similarity: When the diffusion time parameter is less than 0.3, the focus is on generating spatial details; When the diffusion time parameter is greater than 0.7, the focus is on generating temporal continuity.
[0011] As a further aspect of the present invention, the method also includes dynamic path optimization: (6) Generate the camera motion path in the four-dimensional state space, wherein the parameters of the four-dimensional state space include x position, y position, scaling factor and rotation angle; (7) Constraining physical rationality through rigid body motion equations: ; Where M is the virtual camera mass, typically a normalized value of 0.8-1.2; C is the damping coefficient, typically a fixed value of 0.7; K is the stiffness coefficient, typically adaptively adjusted, with K=0.3 for translational motion and K=0.5 for rotational motion; x is the state variable, representing the instantaneous state of the camera in the 4D parameter space; dtdx is the first derivative, describing the camera's motion rate; dt2d2x is the second derivative, describing the trend of camera motion changes; and Fext is the external force, the control signal driving the path change.
[0012] As a further aspect of the present invention: step (6) specifically includes: A trajectory strategy that uses the PPO algorithm to combine multiple camera movement templates; Generate the corresponding physical motion trajectory based on the camera movement description in the text semantics.
[0013] A video generation system implementing the spatiotemporal attention and optical flow constraint video generation method described above includes: Text encoding module: used to map input text into visual semantic vectors; Noise generation module: used to generate temporally coherent multi-frame latent noise tensors; Spatiotemporal attention generation module: includes motion-aware QKV deformation unit and sparsification computation unit, which generate initial video frame sequence; Optical flow constraint module: performs dual-path optical flow prediction and residual compensation; Path optimization module: solves the camera motion trajectory under physical constraints in four-dimensional space.
[0014] As a further aspect of the present invention: the text encoding module includes a visual-text dual-tower encoder and a GPT-4Turbo dynamic prompting engine; The noise generation module integrates a Perlin noise generator and a Brownian motion noise generator. The optical flow constraint module includes a 5-level pyramid matching unit and an LSTM correction unit.
[0015] Compared with the prior art, the beneficial effects of the present invention are: This invention effectively addresses the shortcomings of existing technologies through a series of technical means, achieving significant beneficial effects. To address the problem of inter-frame discontinuity, a temporal noise coupling method (correlation coefficient > 0.9) is employed to control PSNR fluctuations to ≤ 0.5dB. For motion distortion, Kalman filter trajectory compensation (Q = 0.01, R = 0.1) is used, achieving a warping accuracy of 0.85, reaching the current best level. In terms of hardware cost, windowed attention (32-frame sliding window) reduces video memory usage by 25%, requiring only 18GB to process 10 frames of content. From a technical effect chain perspective, optical flow residual compensation improves the physical rationality of motion, thereby improving warping accuracy; spatiotemporal noise coupling enhances inter-frame correlation and effectively reduces PSNR fluctuations. Meanwhile, compared with traditional solutions, spatiotemporal attention U-Net improves inference speed by 3 times, dynamic path optimizer improves trajectory naturalness by 41%, spatiotemporal noise scheduling achieves a score of 9.2 out of 10 on the EDGE evaluation index, and video frame decoder supports real-time generation at 30fps (tested with RTX4090). Overall, while ensuring video quality, it improves generation efficiency and reduces hardware requirements. Attached Figure Description
[0016] Figure 1 This is a flowchart of the video generation method with spatiotemporal attention and optical flow constraints in an embodiment of the present invention. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] The specific implementation of the present invention will be described in detail below with reference to specific embodiments.
[0019] Please see Figure 1This invention provides a video generation method and system constrained by spatiotemporal attention and optical flow, addressing the shortcomings of existing frame-by-frame diffusion video generation techniques, such as significant inter-frame jitter, long-range motion breaks, and high hardware costs. The video generation system embeds physical constraints into the generation process, achieving four-dimensional (spatial + temporal + noise + semantic) joint optimization. This ensures temporal continuity and content consistency between video frames while reducing hardware resource consumption and improving generation efficiency and quality. Specific details are as follows: I. Overall Plan; The video generation system of this invention mainly includes: a CLIP (visual semantic) text encoder, a multi-frame latent noise initialization module, a spatiotemporal attention U-Net, an optical flow prediction module, a dynamic path optimizer, a spatiotemporal noise scheduling module, and a video frame decoder. These modules work collaboratively to achieve a complete process from text input to 1080P@30fps video output. The specific process is as follows: the text input is converted into a semantic vector by the CLIP text encoder; the multi-frame latent noise initialization module generates initial noise with temporal coherence based on the semantic vector; the spatiotemporal attention U-Net extracts and fuses the spatiotemporal features of the noise; the optical flow prediction module optimizes the inter-frame motion trajectory; the dynamic path optimizer generates a motion path that conforms to physical laws; the spatiotemporal noise scheduling module controls the noise attenuation rhythm; and finally, the target video is output by the video frame decoder.
[0020] II. Detailed descriptions of each module; 1. The CLIP text encoder has the following structure: The CLIP text encoder employs a dual-tower design, specifically including: ViT-L / 14 visual encoder: contains 24 Transformer layers for extracting visual features; RoBERTa text encoder: contains 16 Transformer layers for processing text input; Cross-modal projection head: an MLP adaptation layer for 768-dimensional to 1024-dimensional models, enabling alignment of text and image feature spaces; Dynamic suggestion engineering module: A semantic enhancer based on GPT-4Turbo, used to expand the details of text descriptions.
[0021] Therefore, the core function of this module is to map text input (such as "a city night scene with cherry blossoms falling") into a 768-dimensional visual semantic vector, and align the image and text feature spaces through contrastive learning. The dynamic prompting module can automatically add modifiers such as "4K resolution, cinematic camera work" to enhance the richness of the text semantics and provide more accurate semantic guidance for subsequent video generation.
[0022] 2. The structure of multi-frame latent noise initialization is as follows: Temporal coherent noise generator: combines Perlin noise (ensuring spatial continuity) and Brownian motion noise (ensuring temporal continuity). Diffusion process scheduler: Based on the noise attenuation curve of SDE (stochastic differential equation), it controls the dynamic changes of noise; Semantic-guided modulator: Injects the semantic vector output by the CLIP text encoder into the noise generation process, so that the noise is associated with the semantics of the text.
[0023] Therefore, this module generates a 1024×576 latent noise tensor for each frame of the video, and ensures smoothness between video frames through temporal coherence constraints (noise similarity between adjacent frames > 0.85). Its innovation lies in achieving the correlation modulation between the noise spectrum and the text semantics through a semantically guided modulator, so that the initial noise carries the semantic information of the text description, laying the foundation for the subsequent generation process.
[0024] 3. Spatiotemporal Attention U-Net: Spatiotemporal Attention U-Net is the core module for realizing joint modeling of spatiotemporal features, including two key components: 3D convolutional kernel and cross-frame attention.
[0025] (1) 3D convolution kernel; Structural parameters: A 5×3×3 convolution kernel is used, with the temporal domain covering 5 frames and the spatial domain covering 3×3. Dynamic dilation mechanism: The temporal dilation coefficient is adaptively adjusted according to the motion intensity (range 1~5 frames) to adapt to scenes with different motion speeds; Multi-scale fusion: Parallel processing of four resolution features from 16×16 to 256×256 to achieve multi-scale information fusion.
[0026] The feature fusion formula is as follows: ; Where (x,y) are spatial coordinates, t is the time step, and W is the learnable convolution kernel parameter. By performing joint convolution in the spatial and temporal dimensions, the correlation modeling of continuous frame features is achieved.
[0027] (2) Cross-frame attention; Windowed attention: Divide the video into a sliding window of 32 frames (50% overlap) to reduce the complexity of long sequence processing; Motion-aware QKV: By deforming the Key and Value matrices through the optical flow field, attention calculations can better reflect actual motion patterns; Sparsity strategy: Global attention is only calculated for the first 10% of the motion amplitude to reduce redundant computation.
[0028] The implementation process is as follows: Query source: The current frame feature (current_frame_feature) is used as the "questioner" for which the information to be retrieved is obtained; Key construction: The features of the previous frame (prev_frames), the current frame (current_frame), and the next frame (next_frames) are concatenated to form an information pool containing the temporal context. If the feature dimension of each frame is d_k, then the key dimension after concatenation is 3*d_k. Attention weights are calculated using dot product similarity and Softmax normalization, with the following formula: ; in, Calculate the cosine similarity between the current frame and the features at each temporal position; This is a scaling factor (to avoid gradient instability caused by increased dimensionality). The similarity is transformed into a probability distribution to ensure the continuity of features between adjacent frames.
[0029] Therefore, feature extraction is achieved in the 4D spatiotemporal dimension (batch × time × height × width × channel), short-term motion patterns are captured by 3D convolution, and long-term spatiotemporal dependencies are modeled by cross-frame attention, which improves the inference speed by 3 times compared with traditional solutions.
[0030] 4. Optical Flow Prediction Module: This module optimizes inter-frame motion consistency through optical flow residual calculation and motion trajectory compensation, and includes the following components: (1) Calculation of optical flow residual:; Dual-frame input: The RGB difference map between the current frame and the frames before and after ±2 frames is used as input; Pyramid matching: Performs 5-level optical flow estimation at 1 / 8 to 1 resolution to improve estimation accuracy; Iterative correction mechanism: Combines LSTM for three iterations of optimization to correct optical flow prediction errors.
[0031] (2) Motion trajectory compensation; Trajectory smoothing filtering: A Kalman filter (Q=0.01, R=0.1) is used to smooth the motion trajectory; Occlusion handling module: Identifies occluded areas based on depth estimation and repairs them; Subpixel alignment: Achieve subpixel-level inter-frame alignment using a differentiable bilinear sampler.
[0032] (3) Optical flow constraint principle; The rationality of physical motion is ensured by bidirectional optical flow constraints, and the loss function is as follows: ; Wherein, λ1 is the weighting coefficient of the forward optical flow loss term (typically 1.0-2.0), which controls the degree of importance attached to the accuracy of forward optical flow prediction; λ2 is the weighting coefficient of the forward and backward consistency loss term (typically 0.5-1.5), which adjusts the constraint strength on the consistency of forward and backward optical flow. ϕ forward The forward optical flow field predicted by the model (tensor dimension (B,2,H,W)) represents the pixel displacement from the current frame to the next frame; ϕ GT For the true forward optical flow field (and ϕ) forward (same dimension), as a reference standard; ϕ backward The backward optical flow field predicted by the model, and ϕ forward It satisfies the reversibility constraint; I is the unit transformation matrix ((H,W) is an all-1 matrix), representing the ideal state without displacement; ∘ represents the field composition operation.
[0033] This module achieves a state-of-the-art (SOTA) warping accuracy of 0.85 on the UCF101 test set, effectively compensating for inter-frame jitter caused by fast motion.
[0034] 5. The structure of the dynamic path optimizer is as follows: Four-dimensional state space: defines trajectory parameters (x position, y position, scaling factor, rotation angle); Physics Engine Constraints: Introducing Rigid Body Motion Equations ( And virtual camera quality parameters (damping coefficient 0.7); Reinforcement learning strategy: The PPO algorithm is used to optimize the hybrid strategy of 30 camera movement templates to adapt to the camera movement requirements of different scenarios.
[0035] Therefore, a camera motion path conforming to physical laws is generated based on text semantics (such as "drone surround shooting"), and the optimal trajectory is solved in a four-dimensional parameter space. Compared with traditional methods, the trajectory naturalness is improved by 41%, making the video motion more consistent with real physical laws.
[0036] 6. The key mechanisms for spatiotemporal noise scheduling are as follows: Temporal noise coupling: Establish an inter-frame noise correlation matrix (correlation coefficient > 0.9) to enhance inter-frame correlation; Adaptive decay curve: in the early stage (t<0.3), the focus is on spatial detail optimization, and in the later stage (t>0.7), the focus is on ensuring temporal continuity; Semantic-guided reweighting: The noise reduction intensity is dynamically adjusted based on CLIP similarity to make the generated results more closely match the text description.
[0037] Therefore, by controlling the noise attenuation rhythm of the reverse process of the diffusion model and balancing single-frame quality and video coherence through spatiotemporal joint scheduling, a score of 9.2 (out of 10) was achieved on the EDGE evaluation index.
[0038] 7. The structure of a video frame decoder is as follows: Multi-stage upsampling: Feature amplification is achieved sequentially through 4×Nearest interpolation, 3×3 convolution, and spatial attention; Time-domain filtering chain: employs bidirectional LSTM (time-domain smoothing) and non-local filtering (flicker elimination); Post-processing unit: includes AdaptiveSharpening (sharpening level 0.3) and CinemaLight (dynamic range extension).
[0039] Therefore, the 512×288 features of the latent space are decoded into 1080PRGB frames, and details are preserved through mixed precision calculation (FP16 main path + FP32 residual path), supporting real-time generation at 30fps (RTX4090 test).
[0040] III. Core Technology Principles and Key Mechanisms; 1. Four-dimensional joint optimization; Based on the traditional two-dimensional (spatial + noise) path planning of RectifiedFlow, a time axis T and a frame sequence axis are added to achieve four-dimensional joint optimization, as shown in the following formula: ; Where Z is the four-dimensional latent space tensor. The conditional vector, the meaning of each parameter, and the tuning objectives are as follows: v space : Control the naturalness of spatial motion, with a recommended range of 0.1-0.3 (normalized), and the monitoring metric is the warping accuracy of optical flow estimation; v time To ensure time continuity (flicker-free), the recommended range is 0.2-0.5, and the monitoring metric is inter-frame PSNR / SSIM. v noise To balance detail clarity and diversity, a range of 0.05-0.15 is recommended, with monitoring metrics being FID (diversity) + IS (clarity). t: time step (frame sequence); s: spatial position (x, y); : The gradient of the loss function guides the direction of optimization in the latent space: θ is the model parameter, and L is the spatiotemporal joint loss.
[0041] (ii) Dynamic step size adjustment; (1) The noise reduction intensity is adaptively adjusted according to the PSNR difference between adjacent frames. The specific logic is as follows: if ΔPSNR > 0.5dB: step_size *= 0.8 # Enhance noise reduction and improve inter-frame consistency; else: step_size *= 1.2 # Speed up generation and ensure efficiency.
[0042] (2) Based on the above control logic, the following core functions can be achieved: 1. Improve inter-frame consistency: Identify moments of drastic changes in image quality between frames by monitoring ΔPSNR; Actively reduce the step size at these key nodes ("fine mode") to ensure that the output processing results or generated frames can transition smoothly and stably in terms of visuals (details, noise patterns, brightness and color), reducing temporal discontinuities that damage the viewing experience, such as flickering, jittering, and artifacts. This is key to ensuring a smooth and natural viewing experience.
[0043] 2. Optimize efficiency: In flat regions where inter-frame changes are not significant (low ΔPSNR) (such as static scenes and continuous translation), there is no need to invest excessive computing resources in "over-optimization"; By increasing the step size in these regions (“fast mode”), processing time can be significantly reduced or the generated frame rate can be increased. This avoids consistently employing the most refined (and slowest) processing strategy throughout the entire video sequence.
[0044] 3. Adaptive balancing of mass and velocity: The algorithm dynamically adjusts the trade-off between "image quality / consistency" and "processing speed / efficiency"; It is not a fixed setting, but makes real-time decisions based on the instantaneous characteristics (ΔPSNR) of the video content; The goal is to achieve stability when stability is needed (reducing step size to maintain quality) and to accelerate when acceleration is possible (increasing step size to increase speed).
[0045] 4. Reduce computational load: By using larger step sizes in stable regions (which, especially in generative models, means fewer total steps), the overall computational resources (time and computing power) required for processing the entire video sequence are reduced. It facilitates the implementation of real-time or near-real-time applications (such as video calls, real-time enhancement / stylization in cloud gaming).
[0046] 5. Enhance robustness: By responding to ΔPSNR, the algorithm can proactively address different types of challenges in the video: When handling fast motion (where ΔPSNR may increase), switch to robust fine mode; When processing high dynamic range content (which may cause PSNR fluctuations), the transition can also be smoothed by adjusting the step size; Avoid the failure of a single fixed step size strategy when dealing with complex content.
[0047] In summary, this invention, through the above technical solution, achieves targeted optimization to address the shortcomings of the prior art. The specific technical problems, solutions, and quantitative effects are shown in the table below: Technical issues Solution Quantification effect Inter-frame discontinuity Temporal noise coupling (correlation coefficient > 0.9) PNR fluctuation ≤ 0.5dB Motion distortion Kalman filter trajectory compensation (Q=0.01, R=0.1) Warping accuracy 0.85 (SOTA) High hardware costs Windowed attention (32-frame sliding window) VRAM reduced by 25% (18GB / 10 frames) Therefore, the chain of effects of this invention is as follows: Optical flow residual compensation → Improved motion physics rationality → Increased warping accuracy; Noise spatiotemporal coupling → Increased inter-frame correlation → Decreased PSNR fluctuation.
[0048] It should be noted that, in this invention, although the specification describes the embodiments, not every embodiment contains only one independent technical solution. This way of describing the specification is only for clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A video generation method constrained by spatiotemporal attention and optical flow, characterized in that, Includes the following steps: (1) The input text is mapped to a visual semantic vector by a text encoder; (2) Based on the visual semantic vector, generate a temporally coherent multi-frame latent noise tensor; (3) The potential noise tensors of the multi-frame video are feature extracted by spatiotemporal attention U-Net to generate an initial video frame sequence; The spatiotemporal attention U-Net performs the following: Motion-aware cross-frame attention calculation: Using the optical flow field deformation key matrix and value matrix, global attention calculation is performed only on the first 10% of the motion amplitude region; Sparsity processing: The video is divided into a sliding window of 32 frames, with an overlap rate of 50% between adjacent windows, and global attention is calculated only for the top 10% of the regions with the largest motion amplitude.
2. The video generation method constrained by spatiotemporal attention and optical flow according to claim 1, characterized in that, Step (1) specifically includes: Text features were extracted using a visual-text dual-tower encoder. The 768-dimensional features are mapped to 1024 dimensions using a cross-modal projection head; Modifiers in the input text are dynamically expanded using GPT-4 Turbo.
3. The video generation method constrained by spatiotemporal attention and optical flow according to claim 1, characterized in that, Step (2) specifically includes: Perlin noise is used to generate spatially continuous noise, and Brownian motion noise is combined to generate temporally continuous noise; The noise attenuation curve is controlled by stochastic differential equations (SDEs). Visual semantic vectors are injected into the noise generation process to make the noise similarity between adjacent frames >0.
85.
4. The video generation method constrained by spatiotemporal attention and optical flow according to claim 1, characterized in that, The video generation method further includes an optical flow constraint step: (4) Perform dual-path optical flow prediction on the initial video frame sequence: Forward path: Predicts the pixel displacement field from the current frame to the next frame; Reverse path: Calculate the compensation field from the next frame to the current frame; (5) Optimize motion trajectory through optical flow residual compensation: ; in, This represents the weighting coefficient for the forward optical flow loss term; These are the weighting coefficients for the forward and backward consistency loss term; The forward optical flow field predicted by the model; For a true forward optical flow field; The phototropic flow field predicted by the model; is the identity transformation matrix; ∘ represents the field composition operation.
5. The video generation method constrained by spatiotemporal attention and optical flow according to claim 4, characterized in that, Step (4) specifically includes: Five-level pyramid optical flow estimation was performed at 1 / 8 to 1 resolution. An LSTM-assisted iterative correction mechanism was used to optimize the process three times. A Kalman filter is used for trajectory smoothing, with a process noise covariance Q=0.01 and an observation noise covariance R=0.
1.
6. The video generation method constrained by spatiotemporal attention and optical flow according to claim 1, characterized in that, Step (3) also includes noise-semantic joint modulation: Establish an inter-frame noise correlation matrix, wherein the correlation coefficient of the matrix is greater than 0.9; Dynamically adjust the noise reduction intensity based on CLIP vector similarity: When the diffusion time parameter is less than 0.3, the focus is on generating spatial details; When the diffusion time parameter is greater than 0.7, the focus is on generating temporal continuity.
7. The video generation method constrained by spatiotemporal attention and optical flow according to claim 1, characterized in that, The method also includes dynamic path optimization: (6) Generate the camera motion path in the four-dimensional state space, wherein the parameters of the four-dimensional state space include x position, y position, scaling factor and rotation angle; (7) Constraining physical rationality through rigid body motion equations: ; Where M is the virtual camera mass, typically a normalized value of 0.8-1.2; C is the damping coefficient, typically a fixed value of 0.7; K is the stiffness coefficient, typically adaptively adjusted, with K=0.3 for translational motion and K=0.5 for rotational motion; x is the state variable, representing the instantaneous state of the camera in the 4D parameter space; dtdx is the first derivative, describing the camera motion rate; dt²d²x is the second derivative, describing the trend of camera motion change; F ext It is an external force that drives the path change.
8. The video generation method constrained by spatiotemporal attention and optical flow according to claim 7, characterized in that, Step (6) specifically includes: A trajectory strategy that uses the PPO algorithm to combine multiple camera movement templates; Generate the corresponding physical motion trajectory based on the camera movement description in the text semantics.
9. A video generation system implementing the spatiotemporal attention and optical flow constraint video generation method according to any one of claims 1-8, characterized in that, include: Text encoding module: used to map input text into visual semantic vectors; Noise generation module: used to generate temporally coherent multi-frame latent noise tensors; Spatiotemporal attention generation module: includes motion-aware QKV deformation unit and sparsification computation unit, which generate initial video frame sequence; Optical flow constraint module: performs dual-path optical flow prediction and residual compensation; Path optimization module: solves the camera motion trajectory under physical constraints in four-dimensional space.
10. The video generation system of the video generation method with spatiotemporal attention and optical flow constraints according to claim 9, characterized in that, The text encoding module includes a visual-text dual-tower encoder and a GPT-4 Turbo dynamic prompting engine; The noise generation module integrates a Perlin noise generator and a Brownian motion noise generator. The optical flow constraint module includes a 5-level pyramid matching unit and an LSTM correction unit.
