# Fractal Art Pattern Information System Based on Genetic Algorithm

Authors: MengLin Chen
Journal: Journal of Sensors
 (2022)

---

## Abstract

In order to solve the problem of fractal art pattern innovative design in specific fields, this paper proposes a new method of fractal technology and visualization technology based on genetic algorithm to support art pattern innovative design. In these models, the function of the fractal structure is represented by the binary structure, while the main function represented by the wooden structure is the function of creating new offspring. Provide high-quality services to meet customer needs faster and better. The experimental results show that after 14 generations, the force curve appears to be more stable, the weight scale is studied, and a new model is developed. At the same time, the pattern elements of interest to users are retained for genetic algorithm.Conclusion. This method can help designers quickly design fractal art patterns appreciated by users.


---

## Body

## 1. Introduction

In recent decades, major developed industrial countries have begun to pay attention to the research of design technology. For example, since the 1960s, Britain has supported the development and promotion of new design technology with national policies and financial resources; The United States has established a “Design Committee.” Germany put forward the idea of “design is science,” and the development of its design has begun to take shape. Since the 1980s, China has vigorously advocated innovative design, introduced a number of foreign advanced technologies and methods [1], and introduced computer CAD into the design field. In today’s society, with the great improvement of people’s material civilization and spiritual civilization, people’s consumption concept is gradually changing. When buying goods, people pay more and more attention to the artistry and agreeableness of the appearance of goods. As a consumer, when shopping, pay attention to the quality of the product, the price of the product, the function of the product, and the grade of the product. For example, more and more color is due to the layout of external lines, surface textures, and color matching of objects. If the quality of the product depends on the technology; then, the taste of the product, that is, the artistry, depends on the new design of the product [2]. Therefore, for manufacturing enterprises, in order to improve the competitiveness of their products in the market, they must vigorously carry out innovative design of products, especially the innovation of appearance and plastic arts. To enhance market competitiveness, it is necessary to build a “connecting heart bridge” for customers. With good products, how to win the hearts of customers and sell the products to create benefits for the enterprise is the key. Integrity strives for the world, and high quality wins the hearts of customers. This requires the company’s sales staff to communicate well with customers, to reach a consensus and learn from each other’s strengths based on the integrity principle of “win-win interests of both parties” and to fully understand customer needs and indicators, and make products available to customers or downstream production lines. In order to help customers solve practical problems in production, we will win praise from customers, maintain a good cooperation and win-win relationship, and build a “heart-to-heart bridge” for heart-to-heart communication. Innovation and product development have become the keys to the survival and development of the industry. If designers want to be innovative, they need to express their ideas, expand their thinking, and try their best to bring creative inspiration. In other words, how to tap creative inspiration and bring out new ideas has become the key to innovation. Fortunately, advanced computer science and technology can provide designers with a good environment to stimulate creative inspiration.


## 2. Literature Review

Sampath and Selvan discovered that the study of fractal theory began in 1970 and was first proposed by Benoit B. Mandelbort, a researcher in the Department of Physics and a professor in the Department of Mathematics at IBM Research Center, Harvard University 1975 [3]. Ambigapathy and Paramasivam believe that it is a geometric theory used to describe the chaotic characteristics of natural things. Since then, people have a new perspective and research method that can observe and understand natural things [4]. Al-Frady and Al-Taei said that the emergence of fractal theory is a supplement and expansion of Euclidean classical geometry. At the same time, fractal theory makes it possible to describe nature with the help of mathematical language [5]. De and others found that in the late 1970s, fashion designer Jhane Barnes began to engage in the commercial design of men’s shirts [6]. When she used the old-fashioned weaving method to design the cloth on a small manual textile machine, due to the influence of fractal theory, Jhane Barnes realized that the simple rule of fractal can help her design complex clothing styles. After turning to mathematicians and computer software experts Bill Jones and Dana Cartwright, Jhane Barnes got many designs that were impossible to get by hand. Xie and others believe that she has also become the first person to apply fractal theory, thus starting the application of fractal theory in pattern design. When computer expert carpenter realized computer simulation of mountains in aircraft flight scene for Boeing, he divided a triangle into four triangles in three-dimensional space and iterated continuously to generate fractal mountains. This is the first time that fractal theory is used in the rendering of three-dimensional graphics. Since then, people began to try to use fractal theory in various places [7]. Chen and others discussed the texture features of Julia set generated based on escape time algorithm [8]; Cao and others compared the formal beauty of fractal graphics with the aesthetic law of traditional geometric patterns and believed that they were highly consistent [9]. Li and others have been committed to the generation of fractal graphics and the application of fractal graphics in silk scarf printing and dyeing for many years [10]. Peng and others applied the transformed pezley pattern with self similarity to silk scarf design through the analysis of the concept of Mandelbrot set fractal and the principle and characteristics of Mandelbrot set graphics. This paper presents a new method to support the innovative design of artistic patterns by using fractal technology and visualization technology based on genetic algorithm [11]. This method can show that it is feasible and effective to use the existing computing methods and environment to generate images to support the innovative design of artistic patterns in specific fields. Explain that in the genetic algorithm, by adding human-computer interaction, user preferences are integrated into the genetic process to reflect the design ideas of designers. At the same time, the problem that the fitness function is difficult to express in the conceptual design is solved. The adaptive method was adopted to ensure the superiority of the genetic population.


## 3. Research Methods

### 3.1. Art Form and Theory of Fractal Pattern Composition

The composition of the graph consists of two parts: the model structure and the composite model. In fractal art, it mainly refers to the layout and organization form of fractal pattern picture. Composition is the composition of patterns, including pattern structure and picture composition. The data included fractures as standard fractal structures, total fractal structure compositions, and incorrectly configured fractal wing compositions. In drawing, the fractal model retains the mixed plane model and uses all the computer technology in model design, color composition, composition, etc., forming a new art of simulating creative thinking and its realization. Fractal art design and development principles, in addition to the same rules and regulations as the same art form, the most important thing is to use fractal self-similarity and self-affinity, introduce recursion or iteration in the modeling or composition process and randomly affect the local process [12]. Basic procedures include:
(1)
The model is created by iterative operations and repeated application of an algorithm based on a geometric process(2)
Using color coding technology to combine algorithms and human-computer interaction(3)
The graphic typesetting adopts the combination of traditional and fractal algorithm, hybrid technology, etc.


### 3.2. Genetic Algorithm

Genetic algorithm is a research algorithm of natural genetics based on natural selection and biology. Its main characteristics are population search strategy and information exchange among individuals in the population. Genetic algorithm is a search algorithm that can be used for complex system optimization. Compared with traditional algorithms, it has the following four characteristics: first, it takes the coding of decision variables as the operation object; second, genetic algorithm directly uses fitness as search information, without other auxiliary information such as derivatives; third, genetic algorithm uses search information of multiple points, which has implicit parallelism; finally, it does not use nondeterministic rules, but adopts probability search technology. It uses simple coding techniques to represent a wide range of complex processes and facilitates a set of codes to represent research and research decisions for simple genetic manipulation and natural selection of the fittest. It introduces behaviors similar to genetic selection, such as cross recombination, variation, selection, and elimination, into the solution process, reflecting the evolutionary process of “natural selection and survival of the fittest” in nature [13]. Genetic algorithm retains several local optimal solutions at the same time and approaches the optimal solution by multiple genetic operations on several local optimal solutions. Due to its good adaptability, the algorithm is very suitable for nonlinear solutions such as combinatorial optimization and policy discovery, so it is used in many fields.Genetic algorithms are based on the laws of natural evolution. Initially, some people (parent 1, parent 2, ..., parentN) are created to create the first population, the function of each person is calculated, and the first generation (initial generation) is generated. If the optimization process is not met, a new generation group will be created. To produce the next generation, individuals are selected according to physical fitness, and parents need to cross to produce offspring [14]. As a result, all descendants are changed; then, the security of descendants is recalculated. Offspring are placed in the population to replace the parent to create a new generation (children 1, person 2, person 3, ...). Repeat this process until the optimization process is complete, as shown in Figure 1.Figure 1
Flowchart of genetic algorithm.When designing genetic algorithm, the following basic steps are usually followed:(1)
Determine the Coding Scheme. Genetic algorithm does not directly act on the solution space of the problem, but uses some coding representation of the solution space. The choice of encoding representation can sometimes have a positive impact on the performance and functionality of the algorithm [15](2)
Determining Bodily Function. Exercise is a measure of drug quality and depends largely on the relationship between the behavior of the solution and the environment (e.g., population). It is usually expressed in the form of an objective function or a value function. The physical value of the solution is the only basis for selection in the genetic process(3)
Determination of the Concept of Selection. The selection and presentation of the survival of the fittest make the solution of human transformation have a high survival rate, which is one of the common differences between genetic algorithms and research algorithms. Different selection strategies also have a positive impact on the performance of the algorithm(4)
Choice of Control Parameters. Control usually includes population size, algorithm results for different genes, and some other management services.(5)
Genetic Engineering. Genetic engineering in genetic algorithms often includes advanced processes such as breeding, crossbreeding, and mutation(6)
Determining the Order of the Algorithm. Since genetic computing does not use data such as the gradient of the objective function, the position of the person in the solution cannot be determined during the genetic process [16]. Therefore, the traditional method cannot be used to determine the convergence of the algorithm to terminate the algorithm. The common method is to specify a maximum genetic algebra or algorithm in advance. When there is no obvious improvement in the fitness value of the solution after several successive generations, it is terminated and can be terminated appropriately


### 3.3. GeneralizedM−J Set

BothM sets and J sets are obtained by iterating the complex plane mapping z⟶z2+c in a region on the negative plane c. Set M uses c to get the values in this region. The j set is a pattern obtained by taking the median value of the region with a fixed c value. The Julia set patterns corresponding to different c values are different, and the parameter c in a mapped M set corresponds to a connected Julia set. Because M sets and J sets are derived from the same transformation, there is a very complex correlation between them. People often combine them and study them, called M−J sets [17].The current research onM loss and J loss has been decomposed into a simple group of z⟶z2+c, and various equations such as z⟶cosz+c, z⟶arctgz8+sinz+c, called are generalized M sets and generalized J sets.In other words, both generalizedM sets and generalized J sets adopt the iterative relationship z⟶fz+c on the complex plane, where fz is any polynomial (which can include high-order functions, trigonometric functions, and exponential functions). However, the two methods are different in construction and calculation. Given the C value of J set, search all points on the z plane to find the complex structure of attraction and its boundary, that is, draw the graph in the z plane of variable space. The M set is to select an initial Z point, track its iterative point column under different C values, record the structure of the point column on the C plane of the parameter space, and draw graphics. The generalized M set and generalized J set are called generalized M−J set [18].The composition of fractal models based on complex dynamical systems usually depends on the model number. Thus, mathematical models have an impact on the aesthetics of fractal art. The designer can design the necessary model to meet the requirements of the model. It can also be said that the designer looks at the process, and finding a suitable mathematical model is the process of finding a suitable mathematical model.Therefore, in order to grasp this factor affecting the artistry of fractal patterns and find the mathematical formula that can generate fractal patterns with high artistic value, we propose the concept of generalizedM−J set [19]. The generalized fractal formula established by J−M Institute is also based on the following research.


### 3.4. Algorithm Design

#### 3.4.1. Chromosome Coding

Here, we regard the iterative function generating the fractal pattern of generalizedM−J set as an individual in the genetic algorithm population and encode its iterative function. Because the application of binary tree structure to express mathematical expression has great flexibility. Therefore, the structural coding method is adopted here to express the solution of the problem in the form of binary tree, and each tree is a chromosome [20].The mathematical representation of a binary tree is a decision made by mathematicians and mathematicians. This encoding means that the operands of the instruction are at the end of the binary tree, the operands can be changed or rotated, and the operators are in the middle of the binary tree. An order-of-magnitude traversal sequence of a binary tree is a valid mathematical expression.


#### 3.4.2. Establishment of Fitness Function

The fitness function in genetic operation is the basis for evaluating the advantages and disadvantages of genetic evolution chromosome individuals. Here, we use the “satisfaction” and “consensus” of users to design works as the index to measure the quality of genetic chromosomes.The fitness function of this paper adopts the group common scoring model. The group common score adopts the third-order evaluation scale, which divides the user’s preference into three evaluation preferences: “satisfied,” “average,” and “dissatisfied.” Among them, “satisfied” corresponds to 3 points rated by the user, “general” corresponds to 2 points, and “dissatisfied” is 1 point. Accumulate the scores of each user to obtain the satisfaction score of the user. Ifn users participate in the scoring, the satisfaction scoring interval is n,3n. If the satisfaction scores are the same, the fitness function is jointly determined by calculating the consensus standard. Taking Table 1 as an example, although the common score of design work A and design work B is 14, work B does not show a “dissatisfied” attitude, and the degree of consistency of evaluation is high. Therefore, it is more in line with the actual needs of users.Table 1
Users’ ratings of works.
Design art patternUser personal ratingGroup common scoreA1 3 3 2 3 214B2 2 3 2 3 214C1 1 3 2 1 210D1 1 1 2 1 28E3 3 3 2 3 115F1 3 1 2 2 211Set the user evaluation score sequenceVii=1,2,⋯,n and make Vmax=Vj;Vj≥Vi,i=1,2,⋯,n, Vmin=Vk;Vk≥Vi,i=1,2,⋯,n, then, the value of Vi after [0,1] standardization is the following formula.
(1)SVi=Vi−VminVmax−Vmin.Let the degree of consensus beT, and calculate the degree of consensus by using the standard deviation of the following formula.
(2)T=1−∑i=1nVi−V¯2n.The satisfaction is as follows.(3)S¯Vi=∑i=1nSVin,WhereV¯ is the average value of all user evaluation results, i and n are positive integers, and 1≤i≤n.Assuming that the proportion of consensus degree and satisfactionS¯Vi in fitness is u and vu+v=1, respectively, the consensus satisfaction as a fitness function is as follows.
(4)Fitness=uS¯Vi+vT.In the traditional genetic algorithm, the fitness value is determined by the fitness function. However, the subjective evaluation of each user is different. Therefore, there can be no objective fitness function. Therefore, the adaptation value adopted in this paper should be reflected by user scoring. This way of extracting the user’s “satisfaction” and “consensus” through user scoring and then obtaining the adaptive value is the full embodiment of the interactive idea.


#### 3.4.3. Algorithm Flow

Step 1.
Initializes the population. The population randomly generates effective mathematical expressions in the operator set and operand set as the iterative function of generating fractal patterns. The expression string is represented as a binary tree by structural coding.Step 2.
Generates the fitness value of chromosome in the initial population through interaction with the user. Users can evaluate and score the chromosomes in the population to modify their fitness value, so as to carry out genetic selection of the next generation.Step 3.
Generates new populations according to the fitness of chromosomes.Step 4.
Cross and mutate the population.Step 5.
After multiple rounds of evaluation and elimination. If there is a satisfactory result for users, it will be finished; otherwise, it will be transferred to Step2.


## 3.1. Art Form and Theory of Fractal Pattern Composition

The composition of the graph consists of two parts: the model structure and the composite model. In fractal art, it mainly refers to the layout and organization form of fractal pattern picture. Composition is the composition of patterns, including pattern structure and picture composition. The data included fractures as standard fractal structures, total fractal structure compositions, and incorrectly configured fractal wing compositions. In drawing, the fractal model retains the mixed plane model and uses all the computer technology in model design, color composition, composition, etc., forming a new art of simulating creative thinking and its realization. Fractal art design and development principles, in addition to the same rules and regulations as the same art form, the most important thing is to use fractal self-similarity and self-affinity, introduce recursion or iteration in the modeling or composition process and randomly affect the local process [12]. Basic procedures include:
(1)
The model is created by iterative operations and repeated application of an algorithm based on a geometric process(2)
Using color coding technology to combine algorithms and human-computer interaction(3)
The graphic typesetting adopts the combination of traditional and fractal algorithm, hybrid technology, etc.


## 3.2. Genetic Algorithm

Genetic algorithm is a research algorithm of natural genetics based on natural selection and biology. Its main characteristics are population search strategy and information exchange among individuals in the population. Genetic algorithm is a search algorithm that can be used for complex system optimization. Compared with traditional algorithms, it has the following four characteristics: first, it takes the coding of decision variables as the operation object; second, genetic algorithm directly uses fitness as search information, without other auxiliary information such as derivatives; third, genetic algorithm uses search information of multiple points, which has implicit parallelism; finally, it does not use nondeterministic rules, but adopts probability search technology. It uses simple coding techniques to represent a wide range of complex processes and facilitates a set of codes to represent research and research decisions for simple genetic manipulation and natural selection of the fittest. It introduces behaviors similar to genetic selection, such as cross recombination, variation, selection, and elimination, into the solution process, reflecting the evolutionary process of “natural selection and survival of the fittest” in nature [13]. Genetic algorithm retains several local optimal solutions at the same time and approaches the optimal solution by multiple genetic operations on several local optimal solutions. Due to its good adaptability, the algorithm is very suitable for nonlinear solutions such as combinatorial optimization and policy discovery, so it is used in many fields.Genetic algorithms are based on the laws of natural evolution. Initially, some people (parent 1, parent 2, ..., parentN) are created to create the first population, the function of each person is calculated, and the first generation (initial generation) is generated. If the optimization process is not met, a new generation group will be created. To produce the next generation, individuals are selected according to physical fitness, and parents need to cross to produce offspring [14]. As a result, all descendants are changed; then, the security of descendants is recalculated. Offspring are placed in the population to replace the parent to create a new generation (children 1, person 2, person 3, ...). Repeat this process until the optimization process is complete, as shown in Figure 1.Figure 1
Flowchart of genetic algorithm.When designing genetic algorithm, the following basic steps are usually followed:(1)
Determine the Coding Scheme. Genetic algorithm does not directly act on the solution space of the problem, but uses some coding representation of the solution space. The choice of encoding representation can sometimes have a positive impact on the performance and functionality of the algorithm [15](2)
Determining Bodily Function. Exercise is a measure of drug quality and depends largely on the relationship between the behavior of the solution and the environment (e.g., population). It is usually expressed in the form of an objective function or a value function. The physical value of the solution is the only basis for selection in the genetic process(3)
Determination of the Concept of Selection. The selection and presentation of the survival of the fittest make the solution of human transformation have a high survival rate, which is one of the common differences between genetic algorithms and research algorithms. Different selection strategies also have a positive impact on the performance of the algorithm(4)
Choice of Control Parameters. Control usually includes population size, algorithm results for different genes, and some other management services.(5)
Genetic Engineering. Genetic engineering in genetic algorithms often includes advanced processes such as breeding, crossbreeding, and mutation(6)
Determining the Order of the Algorithm. Since genetic computing does not use data such as the gradient of the objective function, the position of the person in the solution cannot be determined during the genetic process [16]. Therefore, the traditional method cannot be used to determine the convergence of the algorithm to terminate the algorithm. The common method is to specify a maximum genetic algebra or algorithm in advance. When there is no obvious improvement in the fitness value of the solution after several successive generations, it is terminated and can be terminated appropriately


## 3.3. GeneralizedM−J Set

BothM sets and J sets are obtained by iterating the complex plane mapping z⟶z2+c in a region on the negative plane c. Set M uses c to get the values in this region. The j set is a pattern obtained by taking the median value of the region with a fixed c value. The Julia set patterns corresponding to different c values are different, and the parameter c in a mapped M set corresponds to a connected Julia set. Because M sets and J sets are derived from the same transformation, there is a very complex correlation between them. People often combine them and study them, called M−J sets [17].The current research onM loss and J loss has been decomposed into a simple group of z⟶z2+c, and various equations such as z⟶cosz+c, z⟶arctgz8+sinz+c, called are generalized M sets and generalized J sets.In other words, both generalizedM sets and generalized J sets adopt the iterative relationship z⟶fz+c on the complex plane, where fz is any polynomial (which can include high-order functions, trigonometric functions, and exponential functions). However, the two methods are different in construction and calculation. Given the C value of J set, search all points on the z plane to find the complex structure of attraction and its boundary, that is, draw the graph in the z plane of variable space. The M set is to select an initial Z point, track its iterative point column under different C values, record the structure of the point column on the C plane of the parameter space, and draw graphics. The generalized M set and generalized J set are called generalized M−J set [18].The composition of fractal models based on complex dynamical systems usually depends on the model number. Thus, mathematical models have an impact on the aesthetics of fractal art. The designer can design the necessary model to meet the requirements of the model. It can also be said that the designer looks at the process, and finding a suitable mathematical model is the process of finding a suitable mathematical model.Therefore, in order to grasp this factor affecting the artistry of fractal patterns and find the mathematical formula that can generate fractal patterns with high artistic value, we propose the concept of generalizedM−J set [19]. The generalized fractal formula established by J−M Institute is also based on the following research.


## 3.4. Algorithm Design

### 3.4.1. Chromosome Coding

Here, we regard the iterative function generating the fractal pattern of generalizedM−J set as an individual in the genetic algorithm population and encode its iterative function. Because the application of binary tree structure to express mathematical expression has great flexibility. Therefore, the structural coding method is adopted here to express the solution of the problem in the form of binary tree, and each tree is a chromosome [20].The mathematical representation of a binary tree is a decision made by mathematicians and mathematicians. This encoding means that the operands of the instruction are at the end of the binary tree, the operands can be changed or rotated, and the operators are in the middle of the binary tree. An order-of-magnitude traversal sequence of a binary tree is a valid mathematical expression.


### 3.4.2. Establishment of Fitness Function

The fitness function in genetic operation is the basis for evaluating the advantages and disadvantages of genetic evolution chromosome individuals. Here, we use the “satisfaction” and “consensus” of users to design works as the index to measure the quality of genetic chromosomes.The fitness function of this paper adopts the group common scoring model. The group common score adopts the third-order evaluation scale, which divides the user’s preference into three evaluation preferences: “satisfied,” “average,” and “dissatisfied.” Among them, “satisfied” corresponds to 3 points rated by the user, “general” corresponds to 2 points, and “dissatisfied” is 1 point. Accumulate the scores of each user to obtain the satisfaction score of the user. Ifn users participate in the scoring, the satisfaction scoring interval is n,3n. If the satisfaction scores are the same, the fitness function is jointly determined by calculating the consensus standard. Taking Table 1 as an example, although the common score of design work A and design work B is 14, work B does not show a “dissatisfied” attitude, and the degree of consistency of evaluation is high. Therefore, it is more in line with the actual needs of users.Table 1
Users’ ratings of works.
Design art patternUser personal ratingGroup common scoreA1 3 3 2 3 214B2 2 3 2 3 214C1 1 3 2 1 210D1 1 1 2 1 28E3 3 3 2 3 115F1 3 1 2 2 211Set the user evaluation score sequenceVii=1,2,⋯,n and make Vmax=Vj;Vj≥Vi,i=1,2,⋯,n, Vmin=Vk;Vk≥Vi,i=1,2,⋯,n, then, the value of Vi after [0,1] standardization is the following formula.
(1)SVi=Vi−VminVmax−Vmin.Let the degree of consensus beT, and calculate the degree of consensus by using the standard deviation of the following formula.
(2)T=1−∑i=1nVi−V¯2n.The satisfaction is as follows.(3)S¯Vi=∑i=1nSVin,WhereV¯ is the average value of all user evaluation results, i and n are positive integers, and 1≤i≤n.Assuming that the proportion of consensus degree and satisfactionS¯Vi in fitness is u and vu+v=1, respectively, the consensus satisfaction as a fitness function is as follows.
(4)Fitness=uS¯Vi+vT.In the traditional genetic algorithm, the fitness value is determined by the fitness function. However, the subjective evaluation of each user is different. Therefore, there can be no objective fitness function. Therefore, the adaptation value adopted in this paper should be reflected by user scoring. This way of extracting the user’s “satisfaction” and “consensus” through user scoring and then obtaining the adaptive value is the full embodiment of the interactive idea.


### 3.4.3. Algorithm Flow

Step 1.
Initializes the population. The population randomly generates effective mathematical expressions in the operator set and operand set as the iterative function of generating fractal patterns. The expression string is represented as a binary tree by structural coding.Step 2.
Generates the fitness value of chromosome in the initial population through interaction with the user. Users can evaluate and score the chromosomes in the population to modify their fitness value, so as to carry out genetic selection of the next generation.Step 3.
Generates new populations according to the fitness of chromosomes.Step 4.
Cross and mutate the population.Step 5.
After multiple rounds of evaluation and elimination. If there is a satisfactory result for users, it will be finished; otherwise, it will be transferred to Step2.


## 3.4.1. Chromosome Coding

Here, we regard the iterative function generating the fractal pattern of generalizedM−J set as an individual in the genetic algorithm population and encode its iterative function. Because the application of binary tree structure to express mathematical expression has great flexibility. Therefore, the structural coding method is adopted here to express the solution of the problem in the form of binary tree, and each tree is a chromosome [20].The mathematical representation of a binary tree is a decision made by mathematicians and mathematicians. This encoding means that the operands of the instruction are at the end of the binary tree, the operands can be changed or rotated, and the operators are in the middle of the binary tree. An order-of-magnitude traversal sequence of a binary tree is a valid mathematical expression.


## 3.4.2. Establishment of Fitness Function

The fitness function in genetic operation is the basis for evaluating the advantages and disadvantages of genetic evolution chromosome individuals. Here, we use the “satisfaction” and “consensus” of users to design works as the index to measure the quality of genetic chromosomes.The fitness function of this paper adopts the group common scoring model. The group common score adopts the third-order evaluation scale, which divides the user’s preference into three evaluation preferences: “satisfied,” “average,” and “dissatisfied.” Among them, “satisfied” corresponds to 3 points rated by the user, “general” corresponds to 2 points, and “dissatisfied” is 1 point. Accumulate the scores of each user to obtain the satisfaction score of the user. Ifn users participate in the scoring, the satisfaction scoring interval is n,3n. If the satisfaction scores are the same, the fitness function is jointly determined by calculating the consensus standard. Taking Table 1 as an example, although the common score of design work A and design work B is 14, work B does not show a “dissatisfied” attitude, and the degree of consistency of evaluation is high. Therefore, it is more in line with the actual needs of users.Table 1
Users’ ratings of works.
Design art patternUser personal ratingGroup common scoreA1 3 3 2 3 214B2 2 3 2 3 214C1 1 3 2 1 210D1 1 1 2 1 28E3 3 3 2 3 115F1 3 1 2 2 211Set the user evaluation score sequenceVii=1,2,⋯,n and make Vmax=Vj;Vj≥Vi,i=1,2,⋯,n, Vmin=Vk;Vk≥Vi,i=1,2,⋯,n, then, the value of Vi after [0,1] standardization is the following formula.
(1)SVi=Vi−VminVmax−Vmin.Let the degree of consensus beT, and calculate the degree of consensus by using the standard deviation of the following formula.
(2)T=1−∑i=1nVi−V¯2n.The satisfaction is as follows.(3)S¯Vi=∑i=1nSVin,WhereV¯ is the average value of all user evaluation results, i and n are positive integers, and 1≤i≤n.Assuming that the proportion of consensus degree and satisfactionS¯Vi in fitness is u and vu+v=1, respectively, the consensus satisfaction as a fitness function is as follows.
(4)Fitness=uS¯Vi+vT.In the traditional genetic algorithm, the fitness value is determined by the fitness function. However, the subjective evaluation of each user is different. Therefore, there can be no objective fitness function. Therefore, the adaptation value adopted in this paper should be reflected by user scoring. This way of extracting the user’s “satisfaction” and “consensus” through user scoring and then obtaining the adaptive value is the full embodiment of the interactive idea.


## 3.4.3. Algorithm Flow

Step 1.
Initializes the population. The population randomly generates effective mathematical expressions in the operator set and operand set as the iterative function of generating fractal patterns. The expression string is represented as a binary tree by structural coding.Step 2.
Generates the fitness value of chromosome in the initial population through interaction with the user. Users can evaluate and score the chromosomes in the population to modify their fitness value, so as to carry out genetic selection of the next generation.Step 3.
Generates new populations according to the fitness of chromosomes.Step 4.
Cross and mutate the population.Step 5.
After multiple rounds of evaluation and elimination. If there is a satisfactory result for users, it will be finished; otherwise, it will be transferred to Step2.


## 4. Result Analysis

Taking the escape radius algorithm of generalizedM−J set and the escape time algorithm of Newton iterative method to generate fractal patterns as examples to illustrate the application of genetic algorithm in fractal pattern generation in complex dynamic systems.The performance tracking curve of genetic algorithm is shown in Figure2 below. After 14 generations, the fitness curve tends to be stable, indicating that the improved genetic algorithm can search for the appropriate weight threshold.Figure 2
Performance tracking curve of genetic algorithm.Let us assume that the set of operands given isz,z2,z3,z4,z−1,z−2,z−3,z−4,ez,sinz,cosz,tanz,ctgz,a. Wherez=x+yi, a is any constant. The operator set is B+,−,∗,/.The initial set of operators consists of a set of binary operators and a set of random operators. The steps of building a binary tree are randomly select multiple elements in the operator set as the intermediate node and randomly select multiple elements in the operand set as the end node of the binary tree [21]. Each binary tree represents an iterative function. For example, we select three spanning trees from the initial population generated according to sets A and B: tree A and tree B, and tree C is shown in Figures 3, 4, and 5.Figure 3
Tree A3z2−2z−2+sinz∗cosz−2.Figure 4
Tree Bz−4/z4−ctgz−1.Figure 5
Tree C2z−4/z4−2sinz∗tanz−cosz.Let 100 users rate and evaluate the pattern generated by the iterative function. Calculate the user’s consensus degree through formula (2), calculate the user’s satisfaction through formula (3), and finally calculate the fitness value of each fractal design pattern through formula (4). According to the fitness value, excellent chromosomes are selected to produce the next generation.The selected chromosome lines are crossed and mutated to generate individuals in a new population. Here, it is assumed that tree A and tree B are crossed. Among them, the “-” node of the left subtree of tree A and the “/” node of the left subtree of tree B are randomly selected as intersections. The exchanged part is a subtree rooted at the intersection. The new individuals generated after crossing are tree D and tree e, as shown in Figures6 and 7.Figure 6
Tree D3z2−2z−2ctgz−1.Figure 7
Tree Bz−4/z4+sinz∗cosz−2.In the mutation operation, a new subtree is randomly generated by the program, and this subtree is used to replace the subtree below the selected node. Here, we take tree c as an example for mutation operation. Suppose that the selected mutation node is the “cosz” node on the far right of the right subtree of tree C. The randomly generated subtree is tree F, as shown in Figure8, and the tree generated after the mutation operation of tree c is tree g, as shown in Figure 9.Figure 8
Tree Fsinz∗cosz.Figure 9
Tree G2z−4/z4−2sinz∗tanz−sinz∗cosz.After the above steps, if a user satisfied art design work is generated, stop the operation, otherwise, return to continue the genetic operation.Through the above example, we can see that the idea of genetic algorithm is applied to generate fractal art patterns, and new patterns are automatically generated. At the same time, the pattern elements of interest to users are retained for genetic, so as to help designers quickly design fractal art patterns appreciated by users.


## 5. Conclusion

This paper applies genetic algorithms in computer science to the field of fractal art to create diverse fractal patterns to meet the needs of users. However, due to the problems of single evaluation mechanism, user psychological fatigue, and low convergence efficiency in genetic algorithm, how to reduce the impact on the results of genetic evolution by improving these factors should be the focus of future research.In this paper, the research on the generation method of fractal art pattern based on genetic algorithm is still in the preliminary stage, and there is still much work to be discussed and carried out. The further work mainly includes the following aspects: further improve the genetic algorithm and expand the generation method of fractal art pattern based on genetic algorithm. The improvement of fractal pattern drawing system is based on genetic algorithm.



---

*Source: 9350301-2022-07-29.xml*