Automatic generation system for animation scenes
Through data preprocessing, knowledge graph construction and text analysis, the animated scene automatic generation system solves the existing technology problems of animation scene annotation requirements and insufficient material libraries, and achieves automatic generation of animated scenes with high fit and adaptability. Different times and plot changes.
Patent Information
- Application Number
- CN202111285404.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-02
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-11-02
AI Technical Summary
Existing animation scene automatic generation technology requires labeling each sample, which cannot dynamically change according to specific inputs, and the material library cannot fully meet plot requirements.
Through data preprocessing, knowledge graph construction and text parsing units, semantic analysis, entity relationship definition and scene generation are performed to automatically generate animated scenes, including statistical classification of natural and artificial environments, definition of time constraint rules and details of entity position relationships. change.
It realizes the ability to automatically generate scenes when materials are missing or incomplete, improves the fit and scalability of scenes, and reduces the amount of text annotation.
Smart Images

Figure CN114022596B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a technology in the field of computer image processing, in particular to an automatic generation system of animation scenes. Background Art
[0002] Existing animation scene automatic generation technology generally requires animation element labeling for each sample in the animation scene training set, so the constructed scene cannot change dynamically according to specific input. Summary of the invention
[0003] In view of the above-mentioned deficiencies in the prior art, the present invention proposes an automatic generation system for animation scenes, which statistically classifies natural environments and artificial environments, selects scenes that best fit the plot, and defines constraint rules for different times, thereby showing the changes of the same scene at different times; defines the orientation relationship between different entities, thereby refining the scene, and generates the entire background by splicing various entities, thereby solving the problem that the material library does not fully meet the plot requirements. The present invention can automatically generate scenes when the materials are missing or incomplete.
[0004] The present invention is achieved through the following technical solutions:
[0005] The present invention relates to an automatic generation system of animation scenes, comprising: a data preprocessing unit, a knowledge graph construction unit, a text parsing unit and a scene generation unit, wherein: the data preprocessing unit uses semantic analysis technology to extract scenes, time and actions in the text according to the text information in the original data set, clusters different scenes to obtain scene classification results and defines constraint rules for scenes at different times and fixed connections between actions and scenes; the knowledge graph construction unit supplements the entity information of the graph according to the definition of entities and relationships and the scene classification results, and expands the relationship data of the graph according to the instance and coordinate attributes in the annotation information of the image data set; the text parsing unit performs dependency syntactic analysis, sentence conversion and semantic role labeling in turn according to the text input by the system, obtains the attributes related to each action in the text, and generates an action sequence; the scene generation unit infers relevant scene information from the graph according to the action sequence, and automatically generates the final scene in combination with a material library.
[0006] The present invention relates to an animation scene generation method of the above system, comprising the following steps:
[0007] Step 1) Generate a data set and define rules in different aspects based on data features, specifically: count the natural environment and artificial environment in the story text, classify different scenes and use semantic analysis to extract time information in the text, and define constraints on scenes at different times; define fixed connections between different actions and scenes based on common sense, extract event information from the text, and select appropriate pictures from the material library to construct the scene based on the extracted key information.
[0008] Step 2) construct a knowledge graph, define the positional relationship of the non-directional category and the positional relationship of the absolute directional category; annotate the data set, and expand the knowledge graph according to the instances, coordinates and other attributes in the annotations.
[0009] Step 3) The original text is converted and a syntax tree is generated, and after optimization, the key information required to build the scene is extracted from the syntax tree;
[0010] Step 4) Generate a triple list based on the extracted key information and select appropriate pictures from the material library to construct the scene.
[0011] Technical Effects
[0012] The present invention uses the annotation information of the image data set to expand the graph, takes the instance name of the image data set as the entity data of the graph, and calculates the instance coordinates of the image data set as the position information to obtain the relative relationship between different instances as the relational data of the graph; through sentence conversion, sentences with multiple actions in the text are regarded as complex sentences, and according to the syntactic rules of Chinese, these complex sentences are converted into simple sentences according to different algorithms, which can improve the effect of subsequent semantic role labeling.
[0013] Compared with the prior art, the present invention can realize the automatic generation of animation scenes from text, can identify the scene where each action in the text is located, and automatically generate and appropriately make reasonable expansions based on the text description. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 It is a schematic diagram of the operation flow of an embodiment of the present invention;
[0015] Figure 2 A schematic diagram of dependency syntax of a text parsing module according to an embodiment of the present invention;
[0016] Figure 3 A schematic diagram of semantic annotation of a text parsing module according to an embodiment of the present invention;
[0017] Figure 4 A schematic diagram of a scene graph of a text parsing module according to an embodiment of the present invention. DETAILED DESCRIPTION
[0018] like Figure 1 As shown, this embodiment relates to a method for automatically generating an animation scene, comprising the following steps:
[0019] Step 1: Dataset preprocessing: Generate a dataset and define rules in different aspects based on data features, including:
[0020] 1.1) Obtain a dataset of fairy tales from home and abroad to obtain data in plain text form: This example uses "Hans Christian Andersen's Fairy Tales", "Grimm's Fairy Tales" and "Chinese Classic Fairy Tales"
[0021] 1.2) Count the natural and artificial environments, and classify the scenes using the HowNet semantic similarity clustering algorithm: semantic similarity Sim(w1, w2) = Max i=1,...,n,j=1,...,m Sim(s1, s2), where w1 and w2 represent two words, s1 and s2 represent two different semantic primitives; similarity d is the path distance between s1 and s2 in the hierarchical tree, and a is an adjustable parameter.
[0022] The scenes in this embodiment include: water surface, specifically including sea surface, seabed, lake surface, lake bottom, river surface, river bottom, etc.; sky; land, specifically including villages, towns, wilderness, riverside, lakeside, seaside, field, etc.
[0023] 1.3) Extract the time information appearing in the text through semantic analysis and divide it into specific time and abstract time.
[0024] The time constraints in this embodiment include: specific time, including early morning, morning, noon, afternoon, dusk, evening, midnight, etc.; abstract time, including spring, summer, autumn, and winter.
[0025] When the semantic analysis extracted text does not clearly indicate the time, for outdoor scenes, the sky background color is set to #0090CE, #FFFACD, and #FF4500 in the early morning, noon, and dusk time periods, respectively, and the brightness of the scene is set to 75% and 50% in the evening and midnight.
[0026] When the semantic analysis extracts the text and clearly indicates the time, if it is daytime, it is converted into a time period to set the sky background color. If it is night, the brightness is set according to the formula: 0=0.5+abs(24-time)*8, where: 0 is the brightness and time is the specific time.
[0027] For spring, summer, autumn and winter in abstract time, objects belonging to the characteristics of each season will be added according to the category of the scene, such as newly sprouted branches in spring, scorching sun in summer, fallen leaves in autumn and snow in winter.
[0028] Step 2: Build and improve the knowledge graph, specifically including: considering the complexity of scene content, classify entities into scenes, composites and scene units when defining knowledge graph entities, where: entities classified as scenes include multiple sub-entities, each of which is a composite or scene unit, such as a forest can be composed of trees and grassland; a composite further includes at least one scene unit, such as a forest can be composed of multiple trees, that is, a scene unit is the smallest unit in the scene, such as a tree can be used as a scene unit.
[0029] The knowledge graph constructed in this embodiment includes: entity types: scene and scene unit; relationship types: composite, up, down, left, right, front, back, inside, outside and nearby.
[0030] The improvement means: in order to clearly describe the positional relationship between entities, this embodiment defines two levels of relationships in the knowledge graph, and by calculating the distance and relative orientation between the coordinates of each entity, the positional relationship between the entities can be obtained, and the result is stored in the knowledge graph in the form of <entity 1, positional relationship, entity 2>.
[0031] The relationship between the two levels includes: the relationship between the composition and the scene unit, including synthesis, arrangement and stacking. Arrangement means that the scene units are placed in an orderly and spread out manner, and stacking means that the scene units can overlap and be disordered. If there is no obvious placement rule, it is represented by a synthetic relationship. The relationship between the scene and its child nodes is divided into upper left, upper, upper right, left, middle, right, lower left, lower and lower right in the form of a nine-square grid. The relationship between the composition or scene unit is divided into upper, lower, left, right, front, back and nearby.
[0032] This embodiment performs annotation processing on the image recognition dataset. First, the subject of each picture in the dataset is used as a scene entity in the knowledge graph, and then each instance in the annotation is used as a scene unit. Due to the characteristics of the dataset, the category of the composite material cannot be processed.
[0033] Step 3: Extract key information: Convert the original text into data that is more conducive to model processing, and extract the key information needed to build the scene, including:
[0034] 3.1) Since there are many modal particles or auxiliary words in Chinese, it is necessary to remove these meaningless words at the beginning.
[0035] 3.2) The syntactic structure in the text is obtained through the dependency syntactic analysis model, and a grammatical tree centered on the predicate is obtained. For complex sentences with multiple predicates at the same time, it is necessary to convert them into simple sentences to improve the effect of subsequent steps. This embodiment constructs conversion rules for parallel sentences, "ba" sentences, and passive sentences based on the characteristics of Chinese sentences.
[0036] 3.3) For parallel sentences, firstly, the parallel words (if any) need to be removed from the syntax tree, then the subsequent predicates except the first predicate are marked as the root of the new syntax tree, and the subject or object of the first predicate is supplemented to the new syntax tree as appropriate.
[0037] 3.4) For the "ba" sentence, it is necessary to remove the "ba" from the syntax tree and reconnect the syntax tree.
[0038] 3.5) For passive sentences, the subject and predicate in the grammatical tree need to be flipped as appropriate, and the words indicating passiveness need to be removed from the grammatical tree.
[0039] 3.6) Extract characters, places, time and other factors in the text through named entity recognition model. Considering the particularity of character naming in fairy tales, it is necessary to combine custom rules when extracting characters.
[0040] 3.7) The roles of each component in the syntactic tree are identified through semantic role labeling. Combined with the results of natural language processing, the initiator, receiver, status, time, location and other elements corresponding to each action can be obtained.
[0041] Step 4: Scene generation: Based on the extracted key information, select appropriate pictures from the material library to build the scene, including:
[0042] 4.1) When the text contains a description of the scene in the previous step, it is necessary to calculate and infer the placement of each entity in the scene from the language information. First, analyze the description text and build a dependency tree to describe the relationship between entities in the sentence. The root node of the dependency tree is the preposition indicating the direction, and the left and right nodes of the preposition are the two entities.
[0043] 4.2) After the dependency tree is established, this embodiment uses the triple <entity, locative word, reference object> to describe the spatial relationship of a group of entities. For example, if there is a pillow on the sofa, it can be described as <pillow, on, sofa>.
[0044] 4.3) When there is no scene description in the text or you want to supplement the scene content, you can traverse the root node corresponding to the current scene to the lower layers according to the data in the knowledge graph. The edge between each two nodes is the relative position of the two entities. To keep the data description consistent, it is also expressed in the form of a triple <entity 1, relationship, entity 2>.
[0045] 4.4) Select images that match each entity from the material library based on the triple list. Considering the incompleteness of the material library, when the corresponding image of a certain entity cannot be found, the characteristics of the knowledge graph can be combined to obtain the current node by combining the materials of the sub-nodes.
[0046] After specific practical experiments, when inputting "Mother asked Little Red Riding Hood to bring food to her grandmother who lives in the forest", the experimental data that can be obtained are: 1) Dependency syntactic analysis results: [(1,2,'SBV'),(2,0,'HED'),(3,2,'VOB'),(4,10,'ADV'),(5,9,'ATT'),(6,5,'CMP'),(7,6,'POB'),(8,5,'RAD'),(9,4,'POB'),(10,2,'COO'),(11,10,'VOB')]. 2) Sentence conversion results: ["Mother asked Little Red Riding Hood", "Little Red Riding Hood brought food to her grandmother", "Grandma lives in the forest"]. 3) Semantic role labeling results: [{'action':'instruct','A0':'mother','A1':'Little Red Riding Hood','LOC':'home'},{'action':'send','A0':'Little Red Riding Hood','A1':'grandmother','A2':'food'},{action':'live','A0':'grandmother','LOC':'forest'}]. 4) According to the graph reasoning, the following scenes can be obtained: [('at home', [('at home', 'bottom', 'carpet'), ('at home', 'top', 'mural'), ('carpet', 'above', 'sofa'), ('sofa', 'above', 'cushion')]), ('forest', [('forest', 'both sides', 'forest'), ('forest', 'bottom', 'flower bush'), ('forest', 'arrangement', 'trees'), ('flower bush', 'stacked', 'flowers')])].
[0047] In summary, compared with the prior art, the present invention requires less text annotation, has very little demand for descriptive text in the input text, and the final generated scene has a higher degree of fit and stronger scalability.
[0048] The above-mentioned specific implementation can be partially adjusted in different ways by those skilled in the art without departing from the principle and purpose of the present invention. The protection scope of the present invention shall be based on the claims and shall not be limited by the above-mentioned specific implementation. Each implementation scheme within its scope shall be subject to the constraints of the present invention.
Claims
1. An automatic generation system for animation scenes, characterized in that: include: Data preprocessing unit, knowledge graph construction unit, text parsing unit and scene generation unit, wherein: the data preprocessing unit uses semantic analysis technology to extract scenes, time and actions in the text based on the text information in the original data set, clusters different scenes to obtain scene classification results, and defines the constraint rules for scenes at different times and the fixed connection between actions and scenes; the knowledge graph construction unit supplements the entity information of the graph based on the definition of entities and relationships and the scene classification results, and expands the relationship data of the graph based on the instance and coordinate attributes in the annotation information of the image data set; the text parsing unit performs dependency syntax analysis, sentence conversion and semantic role labeling in turn based on the text input by the system, obtains the attributes related to each action in the text, and generates an action sequence; the scene generation unit infers the relevant scene information from the graph based on the action sequence, and automatically generates the final scene in combination with the material library; The knowledge graph includes: entity types: scene and scene unit; relationship types: composite, up, down, left, right, front, back, inside, outside and nearby; The automatic generation specifically comprises the following steps: Step 1) Generate a data set and define rules in different aspects according to data features, specifically: count the natural environment and artificial environment in the story text, classify different scenes and use semantic analysis to extract time information in the text, and define the constraint rules of different time on the scene; define the fixed connection between different actions and scenes according to common sense, extract event information from the text, and select appropriate pictures from the material library to construct the scene according to the extracted key information; Step 2) construct and improve the knowledge graph, define the positional relationship of the non-directional category and the positional relationship of the absolute directional category; annotate the data set, and expand the knowledge graph according to the instance and coordinate attributes in the annotation; Step 3) The original text is converted and a syntax tree is generated, and after optimization, the key information required to build the scene is extracted from the syntax tree; Step 4) Generate a triple list based on the extracted key information and select appropriate pictures from the material library to construct the scene.
2. The automatic generation system of animation scenes according to claim 1 is characterized in that: The construction of the knowledge graph refers to: when defining knowledge graph entities, the entities are classified into scenes, composites and scene units, wherein: the entities classified as scenes include multiple sub-entities, each sub-entity is specifically a composite or a scene unit, and the composite further includes at least one scene unit, that is, the scene unit is the smallest unit in the scene.
3. The automatic generation system of animation scenes according to claim 1 is characterized in that: The improvement means: in order to clearly describe the positional relationship between entities, two levels of relationships are defined in the knowledge graph, and the positional relationship between entities is obtained by calculating the distance and relative orientation between the coordinates of each entity, and the result is stored in the knowledge graph in the form of <entity 1, positional relationship, entity 2>.
4. The automatic generation system of animation scenes according to claim 3 is characterized in that: The relationship between the two levels includes: the relationship between the composition and the scene unit, the relationship between the scene and its child nodes, and the relationship between the composition or the scene unit.
5. The automatic generation system of animation scenes according to claim 1 is characterized in that: The step 3 specifically includes: 3.1) Since there are many modal particles or auxiliary words in Chinese, it is necessary to remove these meaningless words at the beginning; 3.2) Obtain the syntactic structure in the text through the dependency syntactic analysis model and obtain a grammatical tree centered on the predicate; for complex sentences with multiple predicates at the same time, they need to be converted into simple sentences to improve the effect of subsequent steps; according to the characteristics of Chinese sentences, construct conversion rules for parallel sentences, "ba" sentences, and passive sentences; 3.3) For parallel sentences, firstly, the parallel words need to be removed from the syntax tree, then the subsequent predicates except the first predicate are marked as the root of the new syntax tree, and the subject or object of the first predicate is supplemented to the new syntax tree as appropriate; 3.4) For the "ba" sentence, it is necessary to remove the "ba" from the syntax tree and reconnect the syntax tree; 3.5) For passive sentences, the subject and predicate in the grammatical tree need to be flipped as appropriate, and the words indicating passiveness need to be removed from the grammatical tree; 3.6) Extract characters, places, and time factors from the text through named entity recognition models; considering the particularity of character naming in fairy tales, it is necessary to combine custom rules when extracting characters; 3.7) The roles of each component in the syntactic tree are identified through semantic role labeling, and the initiator, receiver, state, time, and location elements corresponding to each action are obtained by combining the results of natural language processing.
6. The automatic generation system of animation scenes according to claim 1, characterized in that: The step 4 specifically includes: 4.1) When the text contains a description of the scene in the previous step, it is necessary to calculate and infer the placement of each entity in the scene from the language information; first, analyze the description text and establish a relationship dependency tree to describe the relationship between entities in the sentence. The root node of the dependency tree is the preposition indicating the direction, and the left and right nodes of the preposition are the two entities; 4.2) After the dependency tree is established, the triple <entity, locative word, reference object> is used to describe the spatial relationship of a group of entities; 4.3) When there is no scene description in the text or you want to supplement the scene content, traverse from the root node corresponding to the current scene to the lower layers in sequence according to the data in the knowledge graph. The edge between each two nodes is the relative position of the two entities, that is, it is expressed in the form of a triple <entity 1, relationship, entity 2>; 4.4) Select images that match each entity from the material library based on the triple list; when the corresponding image of an entity cannot be found, the current node is obtained by combining the materials of the sub-nodes in combination with the characteristics of the knowledge graph.
Citation Information
Patent Citations
Semantic-driven two-dimensional animation automatic generation method
CN111340920A
