Automatic pattern generation method and system based on cellular automaton

Through the automatic pattern generation method based on cellular automata, the problem of complex and random patterns in the prior art is solved, and the cultural connotation and style characteristics are retained during the pattern generation process is realized, and a controllable and random pattern generation method is provided.

CN119810227AActive Publication Date: 2025-04-11CENT SOUTH UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411808090.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-04-11
Estimated Expiration
2044-12-10

AI Technical Summary

Technical Problem

The prior art is difficult to generate complex and more random patterns, and its unique cultural connotation and style characteristics are easily ignored during the pattern generation process.

Method used

The pattern automatic generation method based on cellular automata is adopted to collect existing patterns, extract the smallest pattern units, and classify and encode and annotate according to the primitives, composition and color dimensions to form a gene library. Then, the canvas to be generated are meshed, and the cell survival status is randomly generated using the cell automata probability update mechanism, and the gene sequence is retrieved from the gene library to decode the filler pattern.

Benefits of technology

It realizes the generation of complex and more random patterns, while retaining the cultural connotation and style characteristics of the patterns, providing a controllable and random pattern generation method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810227A_ABST
    Figure CN119810227A_ABST
Patent Text Reader

Abstract

The invention discloses a cellular automaton-based pattern automatic generation method and system, and the method comprises the steps: collecting an existing pattern, dividing the existing pattern into minimum pattern units, and carrying out the arrangement and classification of all minimum pattern units, so as to obtain different basic patterns; performing gene coding labeling on each basic pattern to obtain gene sequences, and gathering all the gene sequences to form a gene bank; setting the cell survival state of each cell at the initial moment t0; automatically updating the cell survival probability at the tq moment according to the cell survival state at the tq-1 moment in combination with a cellular automaton probabilistic updating mechanism, and randomly generating the cell survival state according to the cell survival probability; and selecting a cell survival state at any moment, calling a gene sequence from the gene pool, decoding the gene sequence to obtain a corresponding basic pattern, and filling the basic pattern into the cells according to the selected cell survival state to form a new pattern.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method for automatically generating patterns based on cellular automata. Background Art

[0002] Traditional patterns contain rich cultural connotations and powerful artistic creativity. Entering the digital age, the rapid development of computer-generated technology provides new opportunities for the innovation and development of traditional patterns.

[0003] In the existing pattern generation methods, machine learning is often used to learn the style of existing patterns, so as to generate new patterns with strong regularity through translation and replication, which has certain limitations and it is difficult to obtain complex and more random patterns.

[0004] In addition, existing technical research tends to overlook the unique cultural connotations and style characteristics of the patterns, and focuses too much on the structural level, which leads to the weakening of cultural attributes in the process of pattern inheritance. Summary of the invention

[0005] In view of this, the present invention provides a method for automatically generating patterns based on cellular automata, so as to at least solve the problem in the prior art that it is difficult to generate complex and more random patterns.

[0006] In order to achieve the above object, the present invention adopts the following technical solution:

[0007] A method for automatically generating patterns based on cellular automata comprises the following steps:

[0008] S1. Collect existing patterns, extract the smallest pattern unit from the existing pattern configuration, sort and classify all the smallest pattern units according to the three dimensions of primitives, composition and color to obtain different basic patterns;

[0009] S2. Gene coding is performed on each basic pattern to obtain the gene sequence corresponding to each basic pattern, and all gene sequences are collected to form a gene library;

[0010] S3. Divide the pattern canvas to be generated into a grid, take each divided cell as a cell, set the cell survival state of each cell at the initial time t0; q-1 The cell survival status at the moment is combined with the cellular automaton probabilistic update mechanism to automatically update t q The cell survival probability at the moment, and the cell survival state is randomly generated according to the cell survival probability; wherein the cell survival state includes: if the current cell is alive, it means that the current cell is filled with a pattern, and if the current cell is dead, it means that the current cell is not filled with a pattern; q = 1, 2, 3...f, f is the number of moments in the preset automatically generated time period;

[0011] S4. Select the cell survival state at any time, retrieve the gene sequence from the gene library and decode it to obtain the corresponding basic pattern, and fill the basic pattern obtained after decoding into the cell according to the cell survival state selected in S3 to form a new pattern.

[0012] Preferably, in S1, after the existing patterns are collected, the patterns with poor quality or repeated patterns are eliminated, and the remaining existing patterns are subjected to composition analysis to divide the smallest pattern units.

[0013] Preferably, in S3, according to t q-1 The cell survival status at the moment is combined with the cellular automaton probabilistic update mechanism to automatically update t q The cell survival probability at the moment, and the specific contents of randomly generating the cell survival state according to the cell survival probability include:

[0014] In each 3*3 grid, perform the following steps respectively:

[0015] Get the cell survival status C of each cell at the initial time t0 ij , and record the cells in the alive state as 1 and the cells in the dead state as 0; i is the row number of the cell, and j is the column number of the cell;

[0016] Get the total number of survival and death status counts of other cells around each cell, and get the cell survival probability at the next moment according to the following rules:

[0017] (1) If the current cell is alive and there are 2 or 3 cells around it that are alive, then the probability that the current cell will still be alive at the next moment is 90%, and the probability of death is 10%;

[0018] (2) If the current cell is alive and there are less than 2 or more than 3 cells around it that are alive, then the probability that the current cell will still be alive at the next moment is 5%, and the probability that it will die is 95%;

[0019] (3) If the current cell dies and there are three cells around it that are still alive, then the probability that the current cell will still be alive at the next moment is 90%, and the probability that it will die is 10%;

[0020] The cell survival status at the next moment is randomly updated according to the cell survival probability combined with random numbers.

[0021] Preferably, style transfer is also included, and the specific contents include:

[0022] Import the gene library constructed in S2 as training samples into the style transfer model to complete the learning of sample style and color;

[0023] The pattern automatically generated in S4 is input into the trained style transfer model to generate a style-transferred pattern.

[0024] Preferably, the specific content of style transfer includes:

[0025] Style transfer is achieved by optimizing the total loss function to minimize the difference between the target generated image and the style image to be transferred;

[0026] Among them, the total loss function is:

[0027] L total =α m,n L content +(1-α m,n )L style +γL tv

[0028]

[0029] Among them, α m,n 、(1-α m,n ) and γ are the weight coefficients of the content loss function, style loss function and smoothness loss function respectively; D m,n is the complexity at pixel point (m, n);

[0030] The content loss function is used to keep the image content unchanged:

[0031]

[0032] in, is the activation value of the target generated image at (m, n) in the lth layer of the convolutional neural network, is the activation value of the style image to be transferred at (m, n) in the lth layer of the convolutional neural network;

[0033] The style loss function is:

[0034]

[0035] in, represents the Frobenius norm, w k is the style loss weight of the lth layer of the convolutional neural network, which is used to balance the style transfer effects of different layers and different regions. The Gram matrix of the target generated image in the lth layer of the convolutional neural network, is the Gram matrix of the style image to be transferred in the lth layer of the convolutional neural network;

[0036] The style information of the style image to be transferred is captured by the Gram matrix, which is:

[0037]

[0038] in, Represents the Gram matrix of the pixel at the mth row and the nth column of the lth layer, and are the activation values ​​of the lth layer respectively; the Gram matrix captures the style information of the image by calculating the inner product between all feature maps in a given layer;

[0039] The smoothness of the image is optimized through the smoothness loss function:

[0040]

[0041] Among them, x m,n is the pixel value at the pixel point (m, n).

[0042] A pattern automatic generation system based on cellular automata, comprising: a data processing module, a gene library construction module, a cell renewal module and a pattern filling module;

[0043] The data processing module is used to collect existing patterns, extract the smallest pattern unit from the existing pattern configuration, and sort and classify all the smallest pattern units according to the three dimensions of primitives, composition and color to obtain different basic patterns;

[0044] The gene library construction module is used to perform gene coding and labeling on each basic pattern, obtain the gene sequence corresponding to each basic pattern, and collect all the gene sequences to form a gene library;

[0045] The cell update module is used to grid the pattern canvas to be generated, and each cell divided is regarded as a cell, and the cell survival state of each cell at the initial time t0 is set; according to t q-1 The cell survival status at the moment is combined with the cellular automaton probabilistic update mechanism to automatically update t q The cell survival probability at the moment, and the cell survival state is randomly generated according to the cell survival probability; wherein the cell survival state includes: if the current cell is alive, it means that the current cell is filled with a pattern, and if the current cell is dead, it means that the current cell is not filled with a pattern; q = 1, 2, 3...f, f is the number of moments in the preset automatically generated time period;

[0046] The pattern filling module is used to select the cell survival state at any time, retrieve the gene sequence from the gene library and decode it to obtain the corresponding basic pattern, and fill the basic pattern obtained after decoding into the cell according to the selected cell survival state to form a new pattern.

[0047] Preferably, it also includes a style transfer module;

[0048] The style transfer module is used to import the gene library constructed by the gene library construction module as a training sample into the style transfer model to complete the learning of sample style and color; the pattern automatically generated in the pattern filling module is input into the trained style transfer model to generate a style-transferred pattern.

[0049] It can be seen from the above technical solutions that, compared with the prior art, the present invention discloses a method for automatically generating patterns based on cellular automata, which has the following beneficial effects:

[0050] The present invention provides a method for automatically generating patterns based on cellular automaton technology. By setting local rules, such as the life and death state of a cell depends on the state of its surrounding cells, a complex and formally beautiful pattern generation process is simulated, providing a controllable and random generation method for the distribution of patterns in the composition. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0052] Figure 1 It is a flow chart of a method for automatically generating patterns based on cellular automata disclosed in the present invention;

[0053] Figure 2 The cell survival state of each cell at any time disclosed in the embodiments of the present invention;

[0054] Figure 3 The cell survival state of each cell at the next moment is obtained according to the probabilistic updating mechanism of cellular automata disclosed in the embodiment of the present invention;

[0055] Figure 4 A pattern formed after filling the basic pattern disclosed in the embodiment of the present invention;

[0056] Figure 5 A pattern formed after filling the basic pattern disclosed in the embodiment of the present invention;

[0057] Figure 6 The pattern is formed by adding a single basic pattern disclosed in the embodiment of the present invention. DETAILED DESCRIPTION

[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0059] The present invention provides a method for automatically generating patterns based on cellular automata, such as Figure 1 As shown, the following steps are included:

[0060] S1. Collect existing patterns, extract the smallest pattern unit from the existing pattern configuration, sort and classify all the smallest pattern units according to the three dimensions of primitives, composition and color to obtain different basic patterns;

[0061] S2. Gene coding is performed on each basic pattern to obtain the gene sequence corresponding to each basic pattern, and all gene sequences are collected to form a gene library;

[0062] S3. Divide the pattern canvas to be generated into a grid, take each divided cell as a cell, set the cell survival state of each cell at the initial time t0; q-1 The cell survival status at the moment is combined with the cellular automaton probabilistic update mechanism to automatically update t q The cell survival probability at the moment, and the cell survival state is randomly generated according to the cell survival probability; wherein the cell survival state includes: if the current cell is alive, it means that the current cell is filled with a pattern, and if the current cell is dead, it means that the current cell is not filled with a pattern; q = 1, 2, 3...f, f is the number of moments in the preset automatically generated time period;

[0063] S4. Select the cell survival state at any time, retrieve the gene sequence from the gene library and decode it to obtain the corresponding basic pattern, and fill the basic pattern obtained after decoding into the cell according to the cell survival state selected in S3 to form a new pattern.

[0064] It should be noted that:

[0065] In this embodiment, the traditional pattern of the Yao ethnic group is used as the existing pattern configuration, and then a new pattern based on the Yao ethnic group pattern is automatically generated.

[0066] After a detailed classification and analysis of the traditional patterns and symbols of the Yao ethnic group, the smallest pattern units are extracted from the traditional patterns of the Yao ethnic group. Each smallest pattern unit is analyzed from the three dimensions of image element, composition and color. The patterns with errors, duplications or low quality are eliminated to obtain basic patterns with high applicability, and the basic patterns are classified.

[0067] In this embodiment, the basic patterns are classified into two main categories: strips and circles. Strip patterns mainly include straight lines, wavy lines, Z-shaped lines, etc., which are used to express natural elements such as mountains, waters, clouds and fog; circular patterns mainly include complete circles, semicircles, dots, etc., which symbolize celestial bodies such as the sun, moon, and stars.

[0068] Since the field of computer image generation has relatively strict requirements on the format of pattern data, the basic patterns are genetically processed into a vector graphic format to meet the format generation requirements of the computer system and ensure that the pattern genes can be effectively identified and recombined by the generation algorithm. That is, each basic pattern is genetically encoded and labeled separately so that each basic pattern corresponds to a set of gene sequences. The gene sequence corresponding to each basic pattern can be obtained to generate the corresponding basic pattern.

[0069] This embodiment uses the Cellular Automata (CA) theory to generate the pattern position space. By setting simple local rules, such as the life and death state of a cell depends on the state of its surrounding cells, a complex pattern generation process can be simulated. This step provides a controllable and somewhat random method for the distribution of patterns in the pattern.

[0070] A cellular automaton is a mathematical model used to simulate the dynamic behavior of complex systems. It consists of a set of cells that update their state in discrete time steps according to a set of rules. The most famous example of a cellular automaton is Conway's "Game of Life", which shows how complex patterns can emerge from simple rules.

[0071] After the pattern position space is generated based on the pattern position space of the cellular automaton, the basic patterns of different categories are loaded into the specified positions according to the previous grouping logic. This process of this embodiment takes into account the interaction between patterns and the harmony of the overall pattern to ensure the complete communication of the beauty and meaning of the final pattern. In the actual application process, the initial pattern position space can be set as needed, that is, the cell survival state of each cell at the initial time t0, and the cells begin to change randomly according to their initial survival state and through the probabilistic update mechanism of the cellular automaton. After pausing the change, the randomly generated pattern position space can be obtained.

[0072] In order to further implement the above technical solution, in S1, after the existing patterns are collected, the patterns with poor quality or repeated are eliminated, and the composition analysis of the remaining existing patterns is performed to divide the smallest pattern units.

[0073] In order to further implement the above technical solution, S3 q-1 The cell survival status at the moment is combined with the cellular automaton probabilistic update mechanism to automatically update tq The cell survival probability at the moment, and the specific contents of randomly generating the cell survival state according to the cell survival probability include:

[0074] In each 3*3 grid, perform the following steps respectively:

[0075] Get the cell survival status C of each cell at the initial time t0 ij , and record the cells in the alive state as 1 and the cells in the dead state as 0; i is the row number of the cell, and j is the column number of the cell;

[0076] Get the total number of survival and death status counts of other cells around each cell, and get the cell survival probability at the next moment according to the following rules:

[0077] (1) If the current cell is alive and there are 2 or 3 cells around it that are alive, then the probability that the current cell will still be alive at the next moment is 90%, and the probability of death is 10%;

[0078] (2) If the current cell is alive and there are less than 2 or more than 3 cells around it that are alive, then the probability that the current cell will still be alive at the next moment is 5%, and the probability that it will die is 95%;

[0079] (3) If the current cell dies and there are three cells around it that are still alive, then the probability that the current cell will still be alive at the next moment is 90%, and the probability that it will die is 10%;

[0080] The cell survival status at the next moment is randomly updated according to the cell survival probability combined with random numbers.

[0081] It should be noted that:

[0082] Based on the original classic cellular automaton rules, the present invention adds a probability factor so that the life and death state of cells is no longer deterministic, but is randomly updated according to a certain probability. This enhanced model will make the generated pattern more unpredictable and random while retaining a certain degree of controllability.

[0083] In this embodiment, the cell survival state of each cell at any time is set as Figure 2 As shown, the setting method of the cell survival status of each cell at any time is carried out in the three preset composition modes of "complex but not chaotic", "dynamic rhythm" and "orderly rhythm" mentioned above, and in each mode, a variety of basic composition methods that conform to its style are preset, namely, the cell survival status.

[0084] According to the probabilistic update mechanism of cellular automata, the cell survival state of each cell at the next moment is obtained as follows: Figure 3 As shown, according to Figure 3The cell survival state shown in the figure is shown in the figure. Different basic patterns are selected to fill in the surviving cells, such as Figure 4 or Figure 5 As shown in the figure, the basic pattern in each cell can be individually adjusted, deleted or added, such as Figure 6 shown.

[0085] In order to further implement the above technical solutions, style transfer is also included, and the specific contents include:

[0086] Import the gene library constructed in S2 as training samples into the style transfer model to complete the learning of sample style and color;

[0087] The pattern automatically generated in S4 is input into the trained style transfer model to generate a style-transferred pattern.

[0088] In this embodiment, a method of transferring style is adopted to transfer the color style in the traditional costumes and handicrafts of the Yao ethnic group to the pattern design. By analyzing the color usage habits of the Yao culture, a color scheme that can express specific emotional colors is selected, so that the designed pattern not only retains the traditional characteristics of the Yao culture, but also adapts to modern aesthetic needs. This embodiment adopts the painting style transfer technology, and realizes the migration of the Yao color style to modern pattern design through the improvement and optimization of the convolutional neural network. First, by analyzing the color usage habits of the Yao culture, this embodiment selects a color scheme that can express specific emotions and cultural characteristics as the target style. Subsequently, the open source project (NeuralStyle) is referenced, which minimizes the difference between the content image and the style image by optimizing a loss function, thereby realizing style transfer. This embodiment makes necessary modifications and optimizations to the project to adapt to the characteristics of the Yao style patterns.

[0089] In order to further implement the above technical solutions, the specific contents of style transfer include:

[0090] Style transfer is achieved by optimizing the total loss function to minimize the difference between the target generated image and the style image to be transferred;

[0091] Among them, the total loss function is:

[0092] L total =α m,n L content +(1-α m,n )L style +γL tv

[0093]

[0094] Among them, α m,n 、(1-α m,n) and γ are the weight coefficients of the content loss function, style loss function and smoothness loss function respectively; D m,n is the complexity at pixel point (m, n);

[0095] The content loss function is used to keep the image content unchanged:

[0096]

[0097] in, is the activation value of the target generated image at (m, n) in the lth layer of the convolutional neural network, is the activation value of the style image to be transferred at (m, n) in the lth layer of the convolutional neural network;

[0098] The style loss function is:

[0099]

[0100] in, represents the Frobenius norm, w k is the style loss weight of the lth layer of the convolutional neural network, which is used to balance the style transfer effects of different layers and different regions. The Gram matrix of the target generated image in the lth layer of the convolutional neural network, is the Gram matrix of the style image to be transferred in the lth layer of the convolutional neural network;

[0101] The style information of the style image to be transferred is captured by the Gram matrix, which is:

[0102]

[0103] in, Represents the Gram matrix of the pixel at the mth row and the nth column of the lth layer, and are the activation values ​​of the lth layer respectively; the Gram matrix captures the style information of the image by calculating the inner product between all feature maps in a given layer;

[0104] The smoothness of the image is optimized through the smoothness loss function:

[0105]

[0106] Among them, x m,n is the pixel value at the pixel point (m, n).

[0107] A pattern automatic generation system based on cellular automata, comprising: a data processing module, a gene library construction module, a cell renewal module and a pattern filling module;

[0108] The data processing module is used to collect existing patterns, extract the smallest pattern unit from the existing pattern configuration, and sort and classify all the smallest pattern units according to the three dimensions of primitives, composition and color to obtain different basic patterns;

[0109] The gene library construction module is used to perform gene coding and labeling on each basic pattern, obtain the gene sequence corresponding to each basic pattern, and collect all the gene sequences to form a gene library;

[0110] The cell update module is used to grid the pattern canvas to be generated, and each cell divided is regarded as a cell, and the cell survival state of each cell at the initial time t0 is set; according to t q-1 The cell survival status at the moment is combined with the cellular automaton probabilistic update mechanism to automatically update t q The cell survival probability at the moment, and the cell survival state is randomly generated according to the cell survival probability; wherein the cell survival state includes: if the current cell is alive, it means that the current cell is filled with a pattern, and if the current cell is dead, it means that the current cell is not filled with a pattern; q = 1, 2, 3...f, f is the number of moments in the preset automatically generated time period;

[0111] The pattern filling module is used to select the cell survival state at any time, retrieve the gene sequence from the gene library and decode it to obtain the corresponding basic pattern, and fill the basic pattern obtained after decoding into the cell according to the selected cell survival state to form a new pattern.

[0112] In order to further implement the above technical solution, a style transfer module is also included;

[0113] The style transfer module is used to import the gene library constructed by the gene library construction module as a training sample into the style transfer model to complete the learning of sample style and color; the pattern automatically generated in the pattern filling module is input into the trained style transfer model to generate a style-transferred pattern.

[0114] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for automatically generating patterns based on cellular automata, characterized in that: The following steps are involved: S1. Collect existing patterns, extract the smallest pattern unit from the existing pattern configuration, sort and classify all the smallest pattern units according to the three dimensions of primitives, composition and color to obtain different basic patterns; S2. Gene coding is performed on each basic pattern to obtain the gene sequence corresponding to each basic pattern, and all gene sequences are collected to form a gene library; S3. Divide the pattern canvas to be generated into a grid, take each divided cell as a cell, set the cell survival state of each cell at the initial time t0; q-1 The cell survival status at the moment is combined with the cellular automaton probabilistic update mechanism to automatically update t q The cell survival probability at the moment, and the cell survival state is randomly generated according to the cell survival probability; wherein the cell survival state includes: if the current cell is alive, it means that the current cell is filled with a pattern, and if the current cell is dead, it means that the current cell is not filled with a pattern; q = 1, 2, 3...f, f is the number of moments in the preset automatically generated time period; S4. Select the cell survival state at any time, retrieve the gene sequence from the gene library and decode it to obtain the corresponding basic pattern, and fill the basic pattern obtained after decoding into the cell according to the cell survival state selected in S3 to form a new pattern.

2. The method for automatically generating patterns based on cellular automata according to claim 1, characterized in that: In S1, after the existing patterns are collected, the patterns with poor quality or repeated patterns are eliminated, and the composition analysis of the remaining existing patterns is performed to divide the smallest pattern units.

3. The method for automatically generating patterns based on cellular automata according to claim 1, characterized in that: In S3, according to t q-1 The cell survival status at the moment is combined with the cellular automaton probabilistic update mechanism to automatically update t q The cell survival probability at the moment, and the specific contents of randomly generating the cell survival state according to the cell survival probability include: In each 3*3 grid, perform the following steps respectively: Get the cell survival status C of each cell at the initial time t0 ij , and record the cells in the alive state as 1 and the cells in the dead state as 0; i is the row number of the cell, and j is the column number of the cell; Get the total number of survival and death status counts of other cells around each cell, and get the cell survival probability at the next moment according to the following rules: (1) If the current cell is alive and there are 2 or 3 cells around it that are alive, then the probability that the current cell will still be alive at the next moment is 90%, and the probability of death is 10%; (2) If the current cell is alive and there are less than 2 or more than 3 cells around it that are alive, then the probability that the current cell will still be alive at the next moment is 5%, and the probability that it will die is 95%; (3) If the current cell dies and there are three cells around it that are still alive, then the probability that the current cell will still be alive at the next moment is 90%, and the probability that it will die is 10%; The cell survival status at the next moment is randomly updated according to the cell survival probability combined with random numbers.

4. The method for automatically generating patterns based on cellular automata according to claim 1, characterized in that: It also includes style transfer, including: Import the gene library constructed in S2 as training samples into the style transfer model to complete the learning of sample style and color; The pattern automatically generated in S4 is input into the trained style transfer model to generate a style-transferred pattern.

5. The method for automatically generating patterns based on cellular automata according to claim 4, characterized in that: The specific contents of style transfer include: Style transfer is achieved by optimizing the total loss function to minimize the difference between the target generated image and the style image to be transferred; Among them, the total loss function is: L total =a m,n L content +(1-a m,n )L style +γL tv Among them, α m,n 、(1-α m,n ) and γ are the weight coefficients of the content loss function, style loss function and smoothness loss function respectively; D m,n is the complexity at pixel point (m, n); The content loss function is used to keep the image content unchanged: in, is the activation value of the target generated image at (m, n) in the lth layer of the convolutional neural network, is the activation value of the style image to be transferred at (m, n) in the lth layer of the convolutional neural network; The style loss function is: in, represents the Frobenius norm, w k is the style loss weight of the lth layer of the convolutional neural network, which is used to balance the style transfer effects of different layers and different regions. The Gram matrix of the target generated image in the lth layer of the convolutional neural network, is the Gram matrix of the style image to be transferred in the lth layer of the convolutional neural network; The style information of the style image to be transferred is captured by the Gram matrix, which is: in, Represents the Gram matrix of the pixel at the mth row and the nth column of the lth layer, and are the activation values ​​of the lth layer respectively; the Gram matrix captures the style information of the image by calculating the inner product between all feature maps in a given layer; The smoothness of the image is optimized through the smoothness loss function: Among them, x m,n is the pixel value at the pixel point (m, n).

6. A system for automatically generating patterns based on cellular automata, based on a method for automatically generating patterns based on cellular automata according to any one of claims 1 to 5, characterized in that: include: Data processing module, gene library construction module, cell renewal module and pattern filling module; The data processing module is used to collect existing patterns, extract the smallest pattern unit from the existing pattern configuration, and sort and classify all the smallest pattern units according to the three dimensions of primitives, composition and color to obtain different basic patterns; The gene library construction module is used to perform gene coding and labeling on each basic pattern, obtain the gene sequence corresponding to each basic pattern, and collect all the gene sequences to form a gene library; The cell update module is used to grid the pattern canvas to be generated, and each cell divided is regarded as a cell, and the cell survival state of each cell at the initial time t0 is set; according to t q-1 The cell survival status at the moment is combined with the cellular automaton probabilistic update mechanism to automatically update t q The cell survival probability at the moment, and the cell survival state is randomly generated according to the cell survival probability; wherein the cell survival state includes: if the current cell is alive, it means that the current cell is filled with a pattern, and if the current cell is dead, it means that the current cell is not filled with a pattern; q = 1, 2, 3...f, f is the number of moments in the preset automatically generated time period; The pattern filling module is used to select the cell survival state at any time, retrieve the gene sequence from the gene library and decode it to obtain the corresponding basic pattern, and fill the basic pattern obtained after decoding into the cell according to the selected cell survival state to form a new pattern.

7. The pattern automatic generation system based on cellular automata according to claim 4, characterized in that: It also includes a style transfer module; The style transfer module is used to import the gene library constructed by the gene library construction module as a training sample into the style transfer model to complete the learning of sample style and color; The pattern automatically generated in the pattern filling module is input into the trained style transfer model to generate a style-transferred pattern.

Citation Information

Patent Citations

  • Method for designing ceramic decorative patterns

    CN102275455A

  • Hunan embroidery image gene construction and Hunan embroidery image digital processing method

    CN107045551A

  • Method and apparatus for processing image

    US20190130590A1

  • Method and apparatus for information processing using cellular automata transform

    WO1997012330A1