Method and system for automatically generating primitive set mapping animation based on neural network

By using a neural network-based primitive set mapping animation generation method, the problems of missing semantics and topological instability in existing technologies are solved. This method achieves structured encoding and multi-dimensional animation effects for icon animations, and is applicable to computer graphics and user interface design.

CN122023604APending Publication Date: 2026-05-12ZHEJIANG UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG UNIV
Filing Date
2026-04-10
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing methods for generating vector icon animations lack explicit modeling of the semantics of graphic structures, resulting in the loss of structural information during the animation process, topological instability, difficulty in compatibility with the SDF rendering pipeline, and monotonous animation effects that cannot adapt to icon pairs of different complexities.

Method used

An animation generation method based on primitive set mapping using neural networks is adopted. By obtaining the starting and target primitive sets, the primitive matching matrix is ​​calculated using the cross-attention mechanism to generate the intermediate primitive sequence, and the animation frames are rendered through Boolean operation of the signed distance field. It supports multi-dimensional animation effects and cross-platform compatibility.

Benefits of technology

It achieves structural semantic expression and topological stability of icon animation, adapts to icon pairs of different complexities, is compatible with SDF rendering scenarios, generates rich multi-dimensional animation effects, and is suitable for computer graphics and user interface design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122023604A_ABST
    Figure CN122023604A_ABST
Patent Text Reader

Abstract

The invention provides a neural network-based primitive set mapping animation automatic generation method and system, and belongs to the field of computer graphics. The method comprises the following steps: acquiring an initial primitive set and a target primitive set, and encoding to obtain corresponding features; calculating a primitive matching matrix by using a neural network model based on a cross attention mechanism based on the features; determining a matching relationship between the initial primitive and the target primitive according to the primitive matching matrix, and generating an intermediate primitive sequence through parameter interpolation for matched primitive pairs; for unmatched primitives, realizing addition or extinction of the primitives through transparency gradient processing; and according to the intermediate primitive sequence and the Boolean operation relationship, generating an animation frame sequence through symbol distance field Boolean operation rendering. According to the method, the structural semantic expression ability, the topological stability and the cross-icon generalization ability of animation generation are remarkably improved, and the method can be widely applied to the fields of user interface dynamic icon design, game engine graphic animation, mobile terminal interaction efficiency and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer graphics, specifically relating to a method and system for automatically generating primitive set mapping animations based on neural networks. Background Technology

[0002] In user interface design and graphical interaction systems, achieving smooth animated transitions between vector icons relies on geometric interpolation techniques and animation generation methods. Previous work has primarily focused on Scalable Vector Graphics (SVG) animation generation.

[0003] For example, in their paper DeepSVG (Depth Vector Image) published at NIPS 2020, Carlier et al. proposed an SVG representation learning method based on a hierarchical generative network. This method models the distribution representation of vector graphics in the latent space by encoding and decoding SVG command sequences, and achieves continuous transitions between different SVG graphics through latent space interpolation, thus supporting SVG animation generation to some extent. This method provides an early exploration path for data-driven vector graphics animation.

[0004] However, DeepSVG primarily relies on command sequences and latent variable interpolation for transition modeling. Its animation process depends on the continuous changes in the overall latent space, lacking explicit modeling of the semantic structure of the graphics, primitive combination relationships, and Boolean operation logic. When two icons differ significantly in structural composition or topological relationships, latent space interpolation alone often fails to guarantee the structural stability and semantic consistency of the transition process.

[0005] In recent years, with the development of text-to-image diffusion models, researchers have proposed a series of automated SVG generation methods. For example, VectorFusion and SVGDreamer methods both utilize the visual priors of pre-trained diffusion models to automatically generate text-to-SVG through differentiable vector rendering and parameter optimization. These methods have achieved significant improvements in visual quality, diversity, and editability. Although the above methods mainly focus on the automatic synthesis of single SVG images, their generation mechanisms and parameter optimization frameworks can theoretically provide a basic representation and transitional starting point for SVG animation generation.

[0006] However, existing technologies have the following key problems: 1. Existing automated icon animation generation solutions mostly use SVG paths or control point sequences as the smallest modeling unit, without explicitly modeling the structural composition and semantic relationships of the graphics. This can easily lead to the loss of structural information during animation and the introduction of semantically ambiguous intermediate states. For example, a circular icon is composed of two concentric circles through Boolean difference operations, but path representation methods can only record the outline and cannot retain the structural information of "the difference between the two circles".

[0007] 2. Path interpolation methods often use fixed linear or Bézier curve interpolation strategies, lacking a learning mechanism for the evolution of icon structures. They cannot adaptively adjust the transition scheme according to the structural differences of icon pairs, which can easily lead to visual jumps or unnatural deformation effects.

[0008] 3. When the number of structures, combinational logic, or topological relationships between the starting icon and the target icon change, the traditional path interpolation process becomes unstable and is prone to problems such as self-intersection, flipping, or artifacts, leading to a decrease in animation quality.

[0009] 4. Existing methods have difficulty distinguishing between the correspondence and addition / deletion relationships of primitives, and without combining the structured primitive representation of the graph, they are prone to losing the semantic information of Boolean operations; some deep learning-based methods rely on end-to-end pixel-level generation and lack the ability to explicitly control the primitive-level structure.

[0010] 5. Existing methods are difficult to integrate directly with real-time rendering pipelines based on symbolic distance fields (SDF). While SDF methods are increasingly used in game engines, mobile UIs, and web graphics, intermediate frames generated by traditional path interpolation methods cannot be directly converted into SDF representations, hindering seamless integration with shader animation pipelines.

[0011] 6. The richness of animation effects is limited. Traditional methods only support simple interpolation of geometric parameters and cannot simultaneously cover multi-dimensional animation channels such as translation, scaling, rotation, color changes, and transparency changes, which is not conducive to generating expressive icon animations.

[0012] In addition, existing methods mostly rely on fixed parameters or manual intervention, lacking adaptability and making it difficult to maintain stable performance under different icon complexities and structural differences, thus limiting their application scope.

[0013] Therefore, there is an urgent need for an integrated method and system that takes into account structural semantic expression capabilities, topological stability, and cross-icon generalization capabilities, and can adapt to icon pairs of different complexities and be compatible with SDF-based real-time rendering scenarios, so as to meet the research and application needs of the fields of computer graphics and user interface design. Summary of the Invention

[0014] To address the technical pain points of existing vector icon animation generation technologies, such as missing structural semantics, topological instability, and incompatibility with SDF rendering pipelines, this invention provides a method and system for automatic generation of primitive set mapping animations based on neural networks. This method integrates structural semantic expression capabilities, topological stability, and cross-icon generalization capabilities, and can adapt to icon pairs of varying complexity and is compatible with real-time rendering scenarios based on SDF, thus meeting the research and application needs in the fields of computer graphics and user interface design.

[0015] To achieve the above-mentioned objectives, this invention provides a method for automatically generating animations based on primitive set mapping using neural networks, comprising the following steps: Obtain the initial primitive set and the target primitive set; each primitive set consists of multiple symbolic distance field basic primitives and their Boolean operation relationships. The features of the initial primitive set and the target primitive set are encoded separately to obtain the features of the initial primitive set and the features of the target primitive set; Based on the initial primitive feature set and the target primitive feature set, a matching matrix between the initial primitive and the target primitive is calculated using a neural network model based on the cross-attention mechanism. The matching relationship between the starting primitive and the target primitive is determined based on the matching matrix. For matching primitive pairs, an intermediate primitive sequence is generated through parameter interpolation. For unmatched primitives, the addition or deletion of primitives is achieved through transparency gradient processing. Animation frame sequence is generated by rendering through Boolean operations on the symbolic distance field, based on the intermediate primitive sequence and Boolean operation relationship.

[0016] Preferably, each graphic element includes at least graphic element Boolean operation type information, graphic element type information, and graphic element geometric parameter information; The Boolean operation type information for the primitives includes: union, difference, and intersection; The graphic element type information includes: circle, rectangle, and triangle; The geometric parameter information of the primitives is encoded as follows: ,in, This provides information on the types of graphic elements. The anchor point parameters determine the position of the primitive in the image space. The scaling parameter determines the size relationship of the primitive relative to a unit space. The rotation parameters determine the orientation of the primitives. The color parameter determines the color of the primitive. The transparency parameter determines the visibility of primitives.

[0017] Preferably, the encoding process includes: The first feature is obtained by one-hot encoding the category information of each primitive in a predefined primitive category vocabulary; the second feature is obtained by one-hot encoding the Boolean operation type information of each primitive in a predefined Boolean operation type vocabulary; and the third feature is obtained by normalizing the geometric parameter information of each primitive. After concatenating the first, second, and third features, the data is mapped to a feature vector using a multilayer perceptron to obtain the initial primitive set features and the target primitive set features.

[0018] Preferably, the calculation of the primitive matching matrix using a neural network model based on a cross-attention mechanism includes: The Transformer architecture is used as the basic framework, and a cross-attention mechanism is introduced. The features of the initial primitive set are used as queries, and the features of the target primitive set are used as keys and values. The similarity matrix is ​​calculated by scaling dot product attention. ,in and These are the learnable query matrix and the key matrix, respectively. Let be the dimension of the key vector. Indicates the characteristics of the initial primitive set. Indicates the starting primitive index, Represents the features of the target primitive set. Indicates the target primitive index; The similarity matrix is ​​normalized row by row to generate a primitive matching matrix.

[0019] Preferably, determining the matching relationship between the starting primitive and the target primitive based on the primitive matching matrix includes: setting a matching probability threshold; when the corresponding element in the primitive matching matrix is ​​greater than the matching probability threshold, determining that the starting primitive and the target primitive are matched; otherwise, using a default mapping strategy to process the primitive correspondence.

[0020] More preferably, the matching probability threshold is set to be greater than or equal to 0.5.

[0021] Preferably, the generation of the intermediate primitive sequence through parameter interpolation includes: Based on the calculated primitive matching matrix, the primitive animation is decomposed into independent channels for translation, scaling, rotation, color, and transparency. Parameter interpolation is performed on each independent channel, and a smooth intermediate primitive sequence is generated by continuous sampling combined with time parameters.

[0022] Preferably, the method of adding or eliminating primitives through transparency gradient processing includes: For primitives that exist in the initial primitive set but not in the target primitive set, their disappearance is achieved by gradually reducing their transparency; for primitives that exist in the target primitive set but not in the initial primitive set, their addition is achieved by gradually increasing their transparency.

[0023] Preferably, the step of generating the animation frame sequence through Boolean operation of the signed distance field includes: Based on the symbolic distance fields of each primitive in the intermediate primitive sequence, the overall symbolic distance field is combined according to Boolean operation relations, where the minimum value is used to represent the union, the negative value of the maximum value is used to represent the difference, and the maximum value is used to represent the intersection. An anti-aliasing threshold function is applied to the overall symbolic distance field to generate pixel color values, which are then combined with the color and transparency parameters of each primitive to obtain the final rendering result. The final rendering result supports both frame-by-frame image sequence and real-time shader rendering.

[0024] On the other hand, the present invention also provides a neural network-based automatic animation generation system for primitive set mapping, used to implement the aforementioned automatic animation generation method for primitive set mapping, including: a primitive set acquisition module, a primitive set encoding module, a primitive set mapping module, an animation generation module, and a rendering output module; The primitive set acquisition module is used to acquire and parse structured primitive set data to obtain the initial primitive set and the target primitive set; The primitive set encoding module is used to encode the features of the initial primitive set and the target primitive set respectively to obtain the initial primitive set features and the target primitive set features; The primitive set mapping module is used to calculate the primitive matching matrix based on the initial primitive feature set and the target primitive feature set using a neural network model based on the cross-attention mechanism. The animation generation module is used to determine the matching relationship between the starting primitive and the target primitive based on the primitive matching matrix. For matched primitive pairs, an intermediate primitive sequence is generated through parameter interpolation. For unmatched primitives, the addition or disappearance of primitives is achieved through transparency gradient processing. The rendering output module is used to generate an animation frame sequence by performing Boolean operations on the symbolic distance field based on the intermediate primitive sequence and Boolean operation relationship.

[0025] Compared with the prior art, the beneficial effects of the present invention include at least the following: (1) The structured input method of primitive set adapts to the parameterized representation requirements of vector icons, significantly improving the ability to express structural semantics, which is superior to the traditional SVG path interpolation method.

[0026] (2) The primitive set mapping model based on cross attention mechanism achieves automatic learning of primitive correspondence through end-to-end training strategy and joint optimization of matching loss, reconstruction loss and smoothness loss, avoiding the limitations of traditional methods that rely on manual rules or fixed interpolation strategies.

[0027] (3) The multi-channel decoupled animation modeling method outputs a detailed description of the changes in primitive parameters, supports complex multi-dimensional animation effects, and provides a quantitative basis for animation generation for dynamic icon design.

[0028] (4) Full-process automation: The threshold adaptive judgment mechanism is used to handle the addition and disappearance of primitives, adapting to icon pairs with different complexities and structural differences, and significantly improving processing efficiency.

[0029] (5) It can be extended to fields such as game engine real-time animation, mobile UI interaction effects, and Web graphics rendering, and has cross-platform and cross-rendering pipeline compatibility, which has broad value in real-time graphics applications. Attached Figure Description

[0030] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.

[0031] Figure 1 This is a flowchart illustrating the automatic generation method for primitive set mapping animation based on neural networks provided by the present invention.

[0032] Figure 2 The logical framework diagram of the automatic generation method for graph primitive set mapping animation based on neural networks provided by the present invention is shown.

[0033] Figure 3 This is a schematic diagram of the graph set mapping neural network model based on the cross-attention mechanism provided by the present invention.

[0034] Figure 4 This is part of the animation effect provided in this embodiment. Detailed Implementation

[0035] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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. The components of the embodiments of the present invention described and given in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0036] The inventive concept of this invention is as follows: Addressing the technical pain points of existing vector icon animation generation technologies, such as missing structural semantics, topological instability, and incompatibility with the SDF rendering pipeline, this invention proposes an automatic animation generation method based on a neural network for primitive set mapping. This method can process primitive sets composed of symbolic distance field basic primitives and their Boolean operation relationships, achieving structured encoding of primitive sets, learning of mapping relationships between primitives, multi-channel parameter interpolation animation generation, and symbolic distance field rendering output. It integrates structural semantic expression capabilities, topological stability, and cross-icon generalization capabilities, and can adapt to icon pairs of varying complexity and is compatible with SDF-based real-time rendering scenarios, thus meeting the research and application needs of computer graphics and user interface design.

[0037] like Figure 1 As shown in the embodiment, the method for automatically generating primitive set mapping animations based on neural networks includes the following steps: S1. Obtain the initial and target primitive sets; each primitive set consists of multiple symbolic distance field primitives and their Boolean operation relationships. The core function of this step is to obtain and parse the initial and target states of the animation; key designs include the definition of structured primitive set data format, primitive procedural coding specifications, and Boolean operation relationship description mechanism, realizing the transformation of icons from traditional path representation to primitive-level parameterized description, providing standardized input for subsequent neural network model processing. Specifically: First, we obtain the primitive sets corresponding to two vector icons, which serve as the starting primitive set A and the target primitive set B for the animation, corresponding to the starting and target states of the animation, respectively. Each primitive set consists of multiple symbolic distance field basic primitives and their Boolean operation relationships. Each primitive includes at least primitive Boolean operation type information, primitive type information, and primitive geometric parameter information. The parameterized description of the icon is achieved through structured primitive set representation.

[0038] Boolean operations on primitives include operations such as union, difference, and intersection.

[0039] The types of graphic elements include circles, rectangles, triangles, and so on.

[0040] The geometric parameter information of primitives is encoded in a programmed format: It means that, among them, This provides information on the types of graphic elements. The anchor point parameters determine the position of the primitive in the image space. The scaling parameter determines the size relationship of the primitive relative to a unit space. The rotation parameters determine the orientation of the primitives. The color parameter determines the color of the primitive. The transparency parameter determines the visibility of primitives.

[0041] Let the initial primitive set be The target primitive set is ,in These are primitive objects, each containing a different number of parameters. The index variable for the starting primitive. The total number of target primitives, This represents the total number of primitives. In this embodiment, we take five-channel parameters—displacement, scaling, rotation, color, and transparency—as an example.

[0042] S2. Encode the features of the initial primitive set and the target primitive set respectively to obtain the features of the initial primitive set and the target primitive set. The core function of this step is to convert the discrete primitive description into a continuous feature representation suitable for processing by a neural network model. The key design is based on a hybrid coding strategy of one-hot coding and multilayer perceptron, and adopts a mechanism that combines discrete attribute coding and continuous parameter normalization to dynamically balance the feature contribution of type information and geometric parameters, avoiding information loss and feature bias. The details are as follows: In the embodiments, such as Figure 2 As shown, after obtaining the primitive set, feature encoding of the primitives is required to generate primitive feature representations suitable for neural network input. First, the primitive type is discretely encoded, and continuous parameters are normalized. Let the original feature vector of the primitives be: , in, Indicates the initial primitive set. The original primitive feature vector of each primitive. Represents the target primitive set. The original primitive feature vector of each primitive. Indicates the initial primitive set. Information on the type of each graphic element. Represents the target primitive set. Information on the type of each graphic element. The anchor point parameters determine the starting primitive set. The position of each primitive in the image space The anchor point parameters determine the target primitive set. The position of each primitive in the image space The scaling parameters determine the starting primitive set. The size relationship of each primitive relative to a unit of space. The scaling parameters determine the target primitive set. The size relationship of each primitive relative to a unit of space. The rotation parameters determine the starting primitive set. The orientation of each element. The rotation parameters determine the target primitive set. The orientation of each element. The color parameters determine the starting primitive set. The color of each element The color parameters determine the target primitive set. The color of each element The transparency parameter determines the starting primitive set. The visibility of each primitive, The transparency parameter determines the target primitive set. The visibility of each primitive, and This is the index variable for the primitive.

[0043] By using a feature encoding network, primitives are mapped to a feature space of uniform dimension: , ,in, For the initial primitive set Feature vectors of primitives For the target primitive set, the Feature vectors of primitives This represents a primitive feature encoding network, which can be constructed from a multilayer perceptron (MLP). The specific encoding process is as follows: For each primitive, the category information is one-hot encoded in a predefined primitive category vocabulary (based on the primitive categories present in the dataset) to obtain the first feature; simultaneously, the Boolean operation type information of each primitive is one-hot encoded in a predefined Boolean operation type vocabulary to obtain the second feature; and the geometric parameter information of each primitive is also normalized to... The third feature is obtained after tracing the range; The first, second, and third features are concatenated and mapped to a feature vector using a multilayer perceptron to obtain the initial primitive set features. and target primitive set features , Indicates the feature index of the initial primitive set. This represents the total number of features in the initial primitive set. Represents the feature index of the target primitive set. This represents the total number of features in the target primitive set.

[0044] S3. Based on the initial primitive feature set and the target primitive feature set, calculate the primitive matching matrix using a neural network model based on the cross-attention mechanism.

[0045] This invention employs a cross-attention-based primitive set mapping neural network model to calculate the matching relationship between two primitive sets. The basic neural network model uses a Transformer architecture, retaining its multi-head attention and global relationship modeling capabilities while further introducing a cross-attention mechanism to explicitly characterize the correspondence between the starting and target primitive sets, thereby enhancing cross-primitive set matching and mapping modeling capabilities.

[0046] Figure 3 The network structure of a specific embodiment is shown. The core function of this step is to automatically learn the correspondence between two primitive sets; the key design utilizes a cross-attention mechanism to achieve cross-primitive set feature interaction, adapting to dynamic characteristics with varying numbers and significant structural differences in primitives, providing reliable primitive matching information for subsequent animation generation. Details are as follows: Based on the cross-attention mechanism, the similarity matrix is ​​calculated by using the features of the initial primitive set as the query and the features of the target primitive set as the key and value, through scaled dot product attention. ,in and These are the learnable query matrix and the key matrix, respectively. is the dimension of the key vector.

[0047] Then, the similarity matrix is ​​normalized row by row using Softmax to obtain the primitive matching matrix. This enables automatic learning of the mapping animation relationship between two primitive sets; among which, Indicates the first primitive in the initial primitive set The primitive is mapped to the first primitive in the target primitive set. The probability of each primitive.

[0048] S4. Determine the matching relationship between the starting primitive and the target primitive based on the primitive matching matrix. For matched primitive pairs, generate an intermediate primitive sequence through parameter interpolation; for unmatched primitives, use transparency gradient processing to add or remove primitives. The core function of this step is to generate a continuous sequence of animation frames. The key design constructs a multi-channel parameter interpolation framework, adopting a decoupled architecture. It learns the change patterns of each dimension through five independent channels: translation, scaling, rotation, color change, and transparency, and generates a smooth intermediate primitive set by continuously sampling the time parameter. An innovative procedural animation coding mechanism is introduced. Based on the decomposability of primitive animation, structured animation description can be achieved without end-to-end pixel-level generation.

[0049] In this embodiment, based on the primitive matching matrix, the primitive animation is decomposed into five independent channels: translation, scaling, rotation, color change, and transparency. The procedural coding form of the primitive animation is as follows: ,in Corresponding displacement ( ), scaling ), rotation ( ), color change ( ),transparency( Five types of animation.

[0050] Next, based on the obtained primitive matching matrix, a probability threshold is used to determine whether a valid match exists. A valid match is considered to exist when the matching probability meets the following conditions: ,in To establish a valid matching threshold, when a valid match exists, it indicates the starting primitive. With target primitive If a mapping relationship exists, primitive parameter interpolation is performed to generate animation and corresponding shaders; if no valid match exists, the default mapping strategy is used to generate primitive correspondences. Users can decide the default mapping relationship themselves.

[0051] For successfully matched primitive pairs, parametric interpolation is performed on each channel. The parametric interpolation formula for each channel is as follows: ,in For interpolation functions, For time parameters, These are the initial primitive parameters. The target primitive parameters; animations from different channels can be calculated independently and then combined and overlaid. The interpolation function... linear function , or a spline curve predicted by a neural network.

[0052] For matching probabilities below a preset threshold For primitives with a general threshold setting greater than or equal to 0.5, the transparency of the disappearing primitive is... The transparency of newly added primitives decays from their original value to zero. The value grows from zero to a target value (which is determined by the user) to achieve adaptive processing of changes in the topology of the primitives, and finally generates an intermediate primitive sequence.

[0053] S5. Based on the intermediate primitive sequence and Boolean operation relationships, an animation frame sequence is generated through Boolean operations on the symbolic distance field. The core function of this step is to transform the intermediate primitive sequence into an animated visualization result and provide its corresponding shader code. The key design of the shader code is based on SDF Boolean operations to calculate the overall symbolic distance field. Combined with the anti-aliasing function and color blending strategy of the shader code, it highlights rendering quality and real-time performance, facilitates engineering deployment, and has the advantages of GPU acceleration and real-time interaction compared to the traditional frame-by-frame rasterization method.

[0054] In the embodiment, based on the symbolic distance fields of each primitive in the intermediate primitive sequence, the overall symbolic distance field is combined according to Boolean operation relations, wherein the Boolean operation relations are: taking the minimum value to represent the union, taking the negative value of the maximum value to represent the difference, and taking the maximum value to represent the intersection. An anti-aliasing threshold function is applied to the overall symbolic distance field to generate pixel color values, which are then combined with the color and transparency parameters of each primitive to obtain the final rendering result. The final rendering result supports both frame-by-frame image sequence and real-time shader rendering.

[0055] On the other hand, based on the same technical concept, the embodiment also provides an automatic animation generation system for primitive set mapping based on neural networks, including: The system includes a primitive set acquisition module, a primitive set encoding module, a primitive set mapping module, an animation generation module, and a rendering output module. The primitive set acquisition module is used to acquire and parse structured primitive set data to obtain the initial primitive set and the target primitive set; The primitive set encoding module is used to encode the features of the initial primitive set and the target primitive set respectively to obtain the initial primitive set features and the target primitive set features; The primitive set mapping module is used to calculate the primitive matching matrix based on the initial primitive feature set and the target primitive feature set using a neural network model based on the cross-attention mechanism. The animation generation module is used to determine the matching relationship between the starting primitive and the target primitive based on the primitive matching matrix. For matched primitive pairs, an intermediate primitive sequence is generated through parameter interpolation. For unmatched primitives, the addition or disappearance of primitives is achieved through transparency gradient processing. The rendering output module is used to generate an animation frame sequence by performing Boolean operations on the symbolic distance field based on the intermediate primitive sequence and Boolean operation relationship.

[0056] like Figure 4 Examples of some of the animation effects generated by this invention. Figure 4Each row in the column represents a frame sequence for an animation example. Frame 0 represents the starting primitive set, and frame 30 represents the target primitive set. Solid black areas represent bitmap information, green borders indicate primitive boundaries using union operations, and red borders and red masks indicate primitive boundaries and their areas using intersection or difference operations. For example, the frame sequence animation in the first column means that the rectangle in the upper right corner (the green-bordered rectangle using union and the red rectangle using difference) rotates over time. The frame sequence animation in the second column shows the addition of three rectangular primitives on the right, which gradually enlarge and expand to the right over time. The frame sequence animation in the third column shows the dynamic process of the red triangle primitive using difference slowly enlarging. The animation in the fourth column shows a more complex situation: the animation of three rings (a green-bordered circle using union and a red circle using difference) vertically translating over time. As time changes, the primitives gradually change through parameter interpolation, thus achieving a smooth icon animation transition effect.

[0057] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for automatically generating animations based on primitive set mapping using neural networks, characterized in that, Includes the following steps: Obtain the initial primitive set and the target primitive set; each primitive set consists of multiple symbolic distance field basic primitives and their Boolean operation relationships. The features of the initial primitive set and the target primitive set are encoded separately to obtain the features of the initial primitive set and the features of the target primitive set; Based on the initial primitive feature set and the target primitive feature set, a primitive matching matrix is ​​calculated using a neural network model based on the cross-attention mechanism; The matching relationship between the starting primitive and the target primitive is determined based on the primitive matching matrix. For matching primitive pairs, an intermediate primitive sequence is generated through parameter interpolation. For unmatched primitives, the addition or deletion of primitives is achieved through transparency gradient processing. Animation frame sequence is generated by rendering through Boolean operations on the symbolic distance field, based on the intermediate primitive sequence and Boolean operation relationship.

2. The method for automatically generating animations based on primitive set mapping according to claim 1, characterized in that, Each graphic element includes at least the graphic element Boolean operation type information, graphic element type information, and graphic element geometric parameter information; The Boolean operation type information for the primitives includes: union, difference, and intersection; The graphic element type information includes: circle, rectangle, and triangle; The geometric parameter information of the primitives is encoded as follows: ,in, This provides information on the types of graphic elements. The anchor point parameters determine the position of the primitive in the image space. The scaling parameter determines the size relationship of the primitive relative to a unit space. The rotation parameters determine the orientation of the primitives. The color parameter determines the color of the primitive. The transparency parameter determines the visibility of primitives.

3. The method for automatically generating animations based on primitive set mapping according to claim 2, characterized in that, The encoding process includes: The first feature is obtained by one-hot encoding the category information of each primitive in a predefined primitive category vocabulary; the second feature is obtained by one-hot encoding the Boolean operation type information of each primitive in a predefined Boolean operation type vocabulary; and the third feature is obtained by normalizing the geometric parameter information of each primitive. After concatenating the first, second, and third features, the data is mapped to a feature vector using a multilayer perceptron to obtain the initial primitive set features and the target primitive set features.

4. The method for automatically generating animations based on primitive set mapping according to claim 1, characterized in that, Step 3, which involves calculating the primitive matching matrix using a neural network model based on a cross-attention mechanism, includes: The Transformer architecture is used as the basic framework, and a cross-attention mechanism is introduced. The features of the initial primitive set are used as queries, and the features of the target primitive set are used as keys and values. The similarity matrix is ​​calculated by scaling dot product attention. ,in and These are the learnable query matrix and the key matrix, respectively. Let be the dimension of the key vector. Indicates the characteristics of the initial primitive set. Indicates the starting primitive index, Represents the features of the target primitive set. Indicates the target primitive index; The similarity matrix is ​​normalized row by row to generate a primitive matching matrix.

5. The method for automatically generating animations based on primitive set mapping according to claim 4, characterized in that, The method of determining the matching relationship between the starting primitive and the target primitive based on the primitive matching matrix includes: setting a matching probability threshold; when the corresponding element in the primitive matching matrix is ​​greater than the matching probability threshold, the starting primitive and the target primitive are determined to be matched; otherwise, the primitive correspondence is processed using a default mapping strategy.

6. The method for automatically generating animations based on primitive set mapping according to claim 1, characterized in that, The method of generating intermediate primitive sequences through parameter interpolation includes: Based on the calculated primitive matching matrix, the primitive animation is decomposed into independent channels for translation, scaling, rotation, color, and transparency. Parameter interpolation is performed on each independent channel, and a smooth intermediate primitive sequence is generated by continuous sampling combined with time parameters.

7. The method for automatically generating animations based on primitive set mapping according to claim 1, characterized in that, The method of adding or eliminating primitives through transparency gradient processing includes: For primitives that exist in the initial primitive set but not in the target primitive set, their disappearance is achieved by gradually reducing their transparency; for primitives that exist in the target primitive set but not in the initial primitive set, their addition is achieved by gradually increasing their transparency.

8. The method for automatically generating animations based on primitive set mapping according to claim 2, characterized in that, The method of generating an animation frame sequence through Boolean operations on the signed distance field includes: Based on the symbolic distance fields of each primitive in the intermediate primitive sequence, the overall symbolic distance field is combined according to Boolean operation relations, where the minimum value is used to represent the union, the negative value of the maximum value is used to represent the difference, and the maximum value is used to represent the intersection. An anti-aliasing threshold function is applied to the overall symbolic distance field to generate pixel color values, which are then combined with the color and transparency parameters of each primitive to obtain the final rendering result. The final rendering result supports both frame-by-frame image sequence and real-time shader rendering.

9. A system for automatically generating primitive set mapping animations based on neural networks, used to implement the method for automatically generating primitive set mapping animations according to any one of claims 1-8, characterized in that, include: The system includes a primitive set acquisition module, a primitive set encoding module, a primitive set mapping module, an animation generation module, and a rendering output module. The primitive set acquisition module is used to acquire and parse structured primitive set data to obtain the initial primitive set and the target primitive set; The primitive set encoding module is used to encode the features of the initial primitive set and the target primitive set respectively to obtain the initial primitive set features and the target primitive set features; The primitive set mapping module is used to calculate the primitive matching matrix based on the initial primitive feature set and the target primitive feature set using a neural network model based on the cross-attention mechanism. The animation generation module is used to determine the matching relationship between the starting primitive and the target primitive based on the primitive matching matrix. For matched primitive pairs, an intermediate primitive sequence is generated through parameter interpolation. For unmatched primitives, the addition or disappearance of primitives is achieved through transparency gradient processing. The rendering output module is used to generate an animation frame sequence by performing Boolean operations on the symbolic distance field based on the intermediate primitive sequence and Boolean operation relationship.