PINN network-based tie-dye stylized pattern generation method and system

Through the PINN network -based method, the physical information of tienation is introduced, and the problem of the infected patterns in the existing technology has been solved.

CN119379848AActive Publication Date: 2025-01-28GUANGDONG UNIV OF TECH
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411424948.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-01-28
Estimated Expiration
2044-10-12

AI Technical Summary

Technical Problem

The prior art does not consider the physical interaction process between the dye and the fabric when generating the tie-dye pattern, resulting in insufficient accuracy and consistency of the generated pattern.

Method used

Adopting a Pinn network -based method, the PINN network model that introduces the physical information of tienation is constructed, the tie -dye pattern data is collected for pre -processing, the training model is used to generate a tie -dye pattern, and similarity assessment is performed through the evaluation index.

Benefits of technology

It improves the accuracy and consistency of tie -dye patterns, reduces experiments and trial and error costs, increases the diversity and creativity of the pattern, and can generate richer tie -dye pattern design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119379848A_ABST
    Figure CN119379848A_ABST
Patent Text Reader

Abstract

The invention provides a tie-dyeing stylized pattern generation method and system based on a PINN network, and the method comprises the steps: collecting a tie-dyeing pattern for preprocessing preparation, and obtaining a pattern data set; constructing a PINN network model, wherein tie-dye physical information is introduced into the model; the data set is adopted to train the PINN network model; and generating a tie-dye pattern by using the trained PINN network model, and performing similarity evaluation on the tie-dye pattern according to an evaluation index.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and system for generating tie-dye stylized patterns based on a PINN network. Background Art

[0002] The tie-dyeing technique in modern inheritance includes hundreds of variations of techniques. Different techniques enable tie-dyeing patterns to produce unique artistic effects. For example, the "roll on twist" technique can produce a rich color gradient and natural changes. Even if thousands of flowers are tied, no two patterns will be exactly the same after dyeing. Therefore, tie-dyeing stylized patterns are widely used in clothing, bed sheets, tablecloths, curtains, wall hangings, shoulder bags, coasters and other fields.

[0003] With the development of digital processing technology, modern tie-dye art has also begun to draw on the design language and tools of digital art to create more novel and unique patterns and colors. At the same time, tie-dyeing techniques are also constantly innovating and developing to adapt to the aesthetic needs and lifestyle of modern society. For example, patent announcement number CN111260755A discloses a digital tie-dye pattern generation method based on deep learning and digital pattern processing, which uses a generative network combined with a computer pattern processing method to obtain a tie-dye pattern. However, the above-mentioned pattern generation method does not take into account the physical interaction between the dye and the fabric in the actual tie-dyeing process. The specific factors such as the permeability, temperature and proportion of the dye will affect the accuracy and consistency of the generated tie-dye pattern.

[0004] Therefore, there is an urgent need for a tie-dye stylized pattern generation method based on a PINN network to solve the problem that the physical interaction effect is not considered in the generation of tie-dye patterns in the prior art. Summary of the invention

[0005] In view of the deficiencies in the prior art, the present invention proposes a method and system for generating tie-dye stylized patterns based on a PINN network.

[0006] The first aspect of the present invention discloses a method for generating a tie-dye stylized pattern based on a PINN network, comprising:

[0007] Collect tie-dye patterns for preprocessing and obtain pattern data sets;

[0008] Constructing a PINN network model, wherein the model introduces tie-dyeing physical information;

[0009] Using the data set to train the PINN network model;

[0010] The trained PINN network model is used to generate a tie-dye pattern, and the tie-dye pattern is evaluated for similarity according to an evaluation index.

[0011] As an optional implementation, in the first aspect of the present invention, the PINN network model includes a generator for generating a pattern and a discriminator for outputting a pattern label, the input of the generator is the constant features and random features of the pattern in the data set, the input of the discriminator is the sample pattern in the data set and the generated pattern output by the generator;

[0012] The generator includes a plurality of fully connected layers and convolutional layers, wherein the fully connected layers are spaced apart from the convolutional layers, the fully connected layers decouple the input random vectors to obtain feature vectors with physical information, the convolutional layers perform incremental training on the input constant features through upsampling and feature learning, and generate tie-dye patterns based on the feature vectors with physical information and the constant features of feature learning through adaptive normalization fusion;

[0013] The discriminator includes several convolutional layers and two fully connected layers. The convolutional layers extract features of the input generated patterns and sample patterns by increasing the number of channels, and every two convolutional layers are divided into a group for downsampling at different scales. The fully connected layer outputs a category label for the pattern after feature extraction and downsampling by the convolutional layer. The category label is used to represent the relationship between the output pattern, the generated pattern and the real pattern.

[0014] As an optional implementation, in the first aspect of the present invention, the pattern generation step of the PINN network model includes:

[0015] A constant feature matrix E in the data set and a random vector A~p(A) obeying uniform distribution are input into the PINN network model, wherein the relationship between the input and output of the PINN network model is expressed as: X=G(A,E), X represents the generated pattern of the output;

[0016] The input random vector A~p(A) is decoupled and converted into a decoupled feature P′=MLP(A) through N fully connected layers and activation functions to reduce the correlation and dependence between features. The number of neurons in each layer of the fully connected layer is the same, and the size and shape of the input random vector A and the output decoupled feature P′ are the same. The output formula of the nth fully connected layer among the N fully connected layers is expressed as:

[0017] M (n) =σ (n) (W (n) M (n-1) +B (n) ), n=(1,2,3,…N)

[0018] Where N represents the maximum number of fully connected layers, n represents the nth fully connected layer among N fully connected layers, and M (n)represents the decoupled feature P′ output by the nth fully connected layer, MLP(A) represents the transformation operation of the random vector A through the fully connected layer and the activation function, and W (n) represents the weight matrix of the nth fully connected layer, B (n) represents the bias matrix of the nth fully connected layer, σ (n) represents the activation function of the nth fully connected layer, M (n-1) represents the decoupled feature P′ output by the n-1th fully connected layer, then M (0) A represents the random vector A of the initial input model;

[0019] The physical diffusion of the two-dimensional plane is introduced into the decoupling feature P′, and the physical information is given to the decoupling feature P′ to obtain the physical feature P. The output formula of the physical feature P is expressed as:

[0020] P = f d (P′)=P′+α·g(C)

[0021] Among them, P′ represents the decoupled features of the fully connected layer output, f d () represents the physical diffusion expression, α represents the weight parameter, C represents the two-dimensional diffusion equation, and g(C) represents the adjustment amount of the physical diffusion calculation.

[0022] As an optional implementation, in the first aspect of the present invention, the pattern generation step of the PI NN network model includes:

[0023] The input constant feature E is upsampled and feature learned by an L-layer convolutional neural network consisting of two convolutional layers to generate a pattern X i , the relationship of the upsampling process is expressed as: X i =FSC(X i-1 ), where X i represents the feature pattern after upsampling at the i-th layer, X i-1 represents the feature pattern before upsampling of the i-th layer, and FSC() represents the fractional stride convolution of the convolutional neural network;

[0024] The physical features P are fused by embedding an adaptive normalization layer between the convolutional layers to retain the pattern features and optimize the pattern quality. The expression of the adaptive normalization layer is:

[0025]

[0026] Among them, X i-1 represents the feature pattern of the input i-th convolutional layer, X i represents the characteristic pattern output by the i-th convolutional layer, μ(P) represents the mean of the physical feature, σ(P) represents the variance of the physical feature, and μ(X i-1 ) represents the mean of the input feature pattern of the i-th convolutional layer, σ(Xi-1 ) represents the variance of the input feature pattern of the i-th convolutional layer, AdaIN() represents the adaptive normalization function;

[0027] The discriminator takes the generated pattern X and the pattern dataset output by the generator as input, and outputs the label Y corresponding to the pattern through the convolutional layer and the fully connected layer. The expression of the label Y is: Y = D(X), where D() represents the label recognition processing.

[0028] As an optional embodiment, in the first aspect of the present invention, the model introduces tie-dye physical information, including:

[0029] A two-dimensional diffusion equation is used to simulate the modeling process of pigment diffusion and mixing. The partial differential equation describing the physical phenomenon is determined according to the factors of tie-dye pigment diffusion and mixing. The two-dimensional diffusion equation is expressed as:

[0030]

[0031] Among them, C is specifically expressed as C(x,y,t), C(x,y,t) represents the pigment concentration at the (x,y) position in the two-dimensional plane and at time t, and D represents the diffusion coefficient of the pigment on the cloth;

[0032] The change of pigment concentration over time and the diffusion relationship of pigment in space are added to the simulation process, and the concentration C at point (i, j) on the two-dimensional plane is calculated by the discrete form of the two-dimensional diffusion equation as follows:

[0033]

[0034] in, represents the concentration of the pigment at point (i, j) at time step n, represents the concentration of the pigment at point (i, j) at time step n+1, Δx represents the coordinate difference between point (i+1, j) and point (i, j) in the x direction of the two-dimensional plane, Δy represents the coordinate difference between point (i+1, j) and point (i, j) in the y direction of the two-dimensional plane, i represents the coordinate position in the x direction of the two-dimensional plane, and j represents the coordinate position in the y direction of the two-dimensional plane;

[0035] According to the effect of increasing the thickness of the cloth on the diffusion and mixing of the pigment, the texture property, water absorption property and temperature property of the cloth are introduced to extend the two-dimensional diffusion simulation to the three-dimensional diffusion simulation. The three-dimensional diffusion equation is expressed as:

[0036]

[0037] Where T represents temperature, C irepresents the concentration of the i-th pigment at the position (x, y, z) at time t, S(T, texture) represents the water absorption coefficient of the fabric, and D i (S(T, texture)) represents the diffusion coefficient of the i-th pigment, u is the convection velocity vector, which is used to represent the influence of fabric flatness and external factors on pigment convection. The external factors include gravity, wind force and electromagnetic force, and R() is a function of pigment concentration and temperature.

[0038] Used to simulate the chemical reaction between pigments, R i (C,T) represents the chemical reaction rate of the i-th pigment;

[0039] The partial differential equation, the two-dimensional diffusion equation and the three-dimensional diffusion equation are converted into a physical loss function and embedded in the PINN network model. The physical loss function is expressed as:

[0040]

[0041] The solution of physical information is introduced into the generator by minimizing the physical loss function, and the generated pattern that satisfies the physical diffusion principle is output.

[0042] As an optional implementation, in the first aspect of the present invention, the adopting the data set to train the PINN network model comprises:

[0043] Get the generated pattern data distribution p of the generator G (X) and the data distribution p of the real patterns in the dataset data (X);

[0044] Based on the data distribution p of the generated pattern G (X) and the data distribution p of the true pattern data The divergence distance between (X) is minimized to determine the approximate solution of the real pattern data output by the PINN network model. During the model training process, the network parameters of the model are adjusted by the adversarial loss function of the generator and the binary cross entropy loss function of the discriminator. The adversarial loss function of the generator without introducing physical information is expressed as:

[0045]

[0046] The discriminator binary cross entropy loss function without introducing physical information is expressed as:

[0047]

[0048] After introducing physical information for training based on the physical loss function embedded in the PINN network model, the hyperparameter λ is added to adjust the weight between the adversarial network loss function and the physical loss function. The expression of the generator loss function is:

[0049] L G =L G′ +λL p

[0050] The expression of the discriminator loss function is:

[0051] L D =L D′ +L G

[0052] The objective function of the PINN network model is expressed as:

[0053]

[0054] Inputting the data set into the PINN network model to alternately train the discriminator and the generator;

[0055] When training the discriminator, the data distribution p of the real pattern data (X) extracts real patterns and random vectors A to perform model training until the objective function is maximized;

[0056] When training the generator, the data distribution p of the real pattern data (X) extracts a random vector and a feature constant E and inputs them into the model training until the objective function is minimized;

[0057] The PINN network model is continuously updated through forward propagation and back propagation.

[0058] As an optional implementation, in the first aspect of the present invention, the similarity evaluation of the tie-dye pattern according to the evaluation index comprises:

[0059] The evaluation indicators are determined to be FID value and PPL value, and the calculation expression of FID value is:

[0060] FID 2 =||μ1-μ2|| 2 +Tr(C1+C2-2(C1C2) 1 / 2 )

[0061] Where μ1 and μ2 are the mean vectors of the true pattern and the generated pattern, respectively; C1 and C2 are the covariance matrices of the true pattern and the generated pattern, respectively; Tr is the trace of the matrix;

[0062] The calculation expression of the PPL value is:

[0063]

[0064] Among them, E GIt is expressed as the expected value of the square of all the pattern gradients generated by the generator, Represented as the gradient of each generated pattern in the feature space;

[0065] The difference between the generated pattern and the real pattern is determined based on the FID value, and the authenticity of the generated pattern is determined based on the balance of the PPL value in analyzing the change of the generated pattern in the feature space. The similarity between the generated pattern and the real pattern is comprehensively determined based on the difference and the authenticity.

[0066] The second aspect of the present invention discloses a tie-dye stylized pattern generation system based on a PINN network, the system comprising:

[0067] A data collection module is used to collect tie-dye patterns for pre-processing and obtain pattern data sets;

[0068] A model building module is used to build a PINN network model, wherein the model introduces tie-dyeing physical information;

[0069] A model training module, used for training the PINN network model using the data set;

[0070] The output evaluation module is used to generate a tie-dye pattern using the trained PI NN network model and perform similarity evaluation on the tie-dye pattern according to the evaluation index.

[0071] The third aspect of the present invention discloses a device for generating a tie-dye stylized pattern based on a PINN network, comprising:

[0072] at least one processor, and

[0073] a memory communicatively connected to the at least one processor; wherein,

[0074] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for generating tie-dye stylized patterns based on a PINN network as disclosed in any one of the first aspects of the present invention.

[0075] The fourth aspect of the present invention discloses a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the PINN network-based tie-dye stylized pattern generation method as described in any one of the first aspect of the present invention.

[0076] Compared with the prior art, the present invention has the following advantages:

[0077] The present invention simulates the diffusion and reaction of dyes on fabrics based on a PINN network model, quickly generates a variety of possible pattern designs, and can simulate complex physical processes, such as the influence of factors such as dye permeability, temperature and proportion on dyeing effects, thereby generating more accurate and consistent tie-dye patterns, which helps to reduce experimental and trial-and-error costs and improve pattern quality. The introduction of the PINN neural network adds the factor of physical interaction between fabrics and dyes in the simulation of tie-dyeing, further increases the diversity and creativity of tie-dye patterns, and can generate richer tie-dye pattern designs. The invention can be widely used in fields with high demands on design sense, such as clothing, bed sheets, tablecloths, curtains, wall hangings, shoulder bags, coasters, etc. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] 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 labor.

[0079] Figure 1 It is a flow chart of the method for generating tie-dye stylized patterns based on PI NN network of the present invention;

[0080] Figure 2 Schematic diagram of the tie-dye stylized pattern generation system based on the PI NN network of the present invention. DETAILED DESCRIPTION

[0081] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0082] Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the content disclosed in this application, some changes in design, manufacturing or production based on the technical content disclosed in this application are just conventional technical means, and should not be understood as insufficient content disclosed in this application.

[0083] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0084] Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantitative limitation, and may represent the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units that are not listed, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects before and after are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0085] Example 1

[0086] See also Figure 1 The embodiment of the present invention discloses a method for generating a tie-dye stylized pattern based on a PINN network, comprising:

[0087] 101. Collect tie-dye patterns for preprocessing and obtain a pattern data set;

[0088] Specifically, a large amount of tie-dye pattern data is collected, including different colors, textures, and designs. The data is preprocessed, including standardization, normalization, data enhancement, etc., and the data is divided into training sets and test sets to facilitate the training of the neural network.

[0089] 102. Construct a PINN network model, wherein the model introduces tie-dyeing physical information;

[0090] As an optional implementation, in the first aspect of the present invention, the PINN network model includes a generator for generating a pattern and a discriminator for outputting a pattern label, the input of the generator is the constant features and random features of the pattern in the data set, the input of the discriminator is the sample pattern in the data set and the generated pattern output by the generator;

[0091] The generator includes a plurality of fully connected layers and convolutional layers, wherein the fully connected layers are spaced apart from the convolutional layers, the fully connected layers decouple the input random vectors to obtain feature vectors with physical information, the convolutional layers perform incremental training on the input constant features through upsampling and feature learning, and generate tie-dye patterns based on the feature vectors with physical information and the constant features of feature learning through adaptive normalization fusion;

[0092] The discriminator includes several convolutional layers and two fully connected layers. The convolutional layers extract features of the input generated patterns and sample patterns by increasing the number of channels, and every two convolutional layers are divided into a group for downsampling at different scales. The fully connected layer outputs a category label for the pattern after feature extraction and downsampling by the convolutional layer. The category label is used to represent the relationship between the output pattern, the generated pattern and the real pattern.

[0093] As an optional implementation, in the first aspect of the present invention, the pattern generation step of the PINN network model includes:

[0094] A constant feature matrix E in the data set and a random vector A~p(A) obeying uniform distribution are input into the PINN network model, wherein the relationship between the input and output of the PINN network model is expressed as: X=G(A,E), X represents the generated pattern of the output;

[0095] The input random vector A~p(A) is decoupled and converted into a decoupled feature P′=MLP(A) through N fully connected layers and activation functions to reduce the correlation and dependence between features. The number of neurons in each layer of the fully connected layer is the same, and the size and shape of the input random vector A and the output decoupled feature P′ are the same. The output formula of the nth fully connected layer among the N fully connected layers is expressed as:

[0096] M (n) =σ (n) (W (n) M (n-1) +B (n) ), n=(1,2,3,…N)

[0097] Where N represents the maximum number of fully connected layers, n represents the nth fully connected layer among N fully connected layers, and M (n)represents the decoupled feature P′ output by the nth fully connected layer, MLP(A) represents the transformation operation of the random vector A through the fully connected layer and the activation function, and W (n) represents the weight matrix of the nth fully connected layer, B (n) represents the bias matrix of the nth fully connected layer, σ (n) represents the activation function of the nth fully connected layer, M (n-1) represents the decoupled feature P′ output by the n-1th fully connected layer, then M (0) A represents the random vector A of the initial input model;

[0098] The physical diffusion of the two-dimensional plane is introduced into the decoupling feature P′, and the physical information is given to the decoupling feature P′ to obtain the physical feature P. The output formula of the physical feature P is expressed as:

[0099] P = f d (P′)=P′+α·g(C)

[0100] Among them, P′ represents the decoupled features of the fully connected layer output, f d () represents the physical diffusion expression, α represents the weight parameter, C represents the two-dimensional diffusion equation, and g(C) represents the adjustment amount of the physical diffusion calculation.

[0101] As an optional implementation, in the first aspect of the present invention, the pattern generation step of the PINN network model includes:

[0102] The input constant feature E is upsampled and feature learned by an L-layer convolutional neural network consisting of two convolutional layers to generate a pattern X i , the relationship of the upsampling process is expressed as: X i =FSC(X i-1 ), where X i represents the feature pattern after upsampling at the i-th layer, X i-1 represents the feature pattern before upsampling of the i-th layer, and FSC() represents the fractional stride convolution of the convolutional neural network;

[0103] The physical features P are fused by embedding an adaptive normalization layer between the convolutional layers to retain the pattern features and optimize the pattern quality. The expression of the adaptive normalization layer is:

[0104]

[0105] Among them, X i-1 represents the feature pattern of the input i-th convolutional layer, X i represents the characteristic pattern output by the i-th convolutional layer, μ(P) represents the mean of the physical feature, σ(P) represents the variance of the physical feature, and μ(X i-1 ) represents the mean of the input feature pattern of the i-th convolutional layer, σ(Xi-1 ) represents the variance of the input feature pattern of the i-th convolutional layer, AdaIN() represents the adaptive normalization function;

[0106] The discriminator takes the generated pattern X and the pattern dataset output by the generator as input, and outputs the label Y corresponding to the pattern through the convolutional layer and the fully connected layer. The expression of the label Y is: Y = D(X), where D() represents the label recognition processing.

[0107] As an optional embodiment, in the first aspect of the present invention, the model introduces tie-dye physical information, including:

[0108] A two-dimensional diffusion equation is used to simulate the modeling process of pigment diffusion and mixing. The partial differential equation describing the physical phenomenon is determined according to the factors of tie-dye pigment diffusion and mixing. The two-dimensional diffusion equation is expressed as:

[0109]

[0110] Among them, C is specifically expressed as C(x,y,t), C(x,y,t) represents the pigment concentration at the (x,y) position in the two-dimensional plane and at time t, and D represents the diffusion coefficient of the pigment on the cloth;

[0111] The change of pigment concentration over time and the diffusion relationship of pigment in space are added to the simulation process, and the concentration C at point (i, j) on the two-dimensional plane is calculated by the discrete form of the two-dimensional diffusion equation as follows:

[0112]

[0113] in, represents the concentration of the pigment at point (i, j) at time step n, represents the concentration of the pigment at point (i, j) at time step n+1, Δx represents the coordinate difference between point (i+1, j) and point (i, j) in the x direction of the two-dimensional plane, Δy represents the coordinate difference between point (i+1, j) and point (i, j) in the y direction of the two-dimensional plane, i represents the coordinate position in the x direction of the two-dimensional plane, and j represents the coordinate position in the y direction of the two-dimensional plane;

[0114] According to the effect of increasing the thickness of the cloth on the diffusion and mixing of the pigment, the texture property, water absorption property and temperature property of the cloth are introduced to extend the two-dimensional diffusion simulation to the three-dimensional diffusion simulation. The three-dimensional diffusion equation is expressed as:

[0115]

[0116] Where T represents temperature, C irepresents the concentration of the i-th pigment at the position (x, y, z) at time t, S(T, texture) represents the water absorption coefficient of the fabric, and D i (S(T, texture)) represents the diffusion coefficient of the i-th pigment, u is the convection velocity vector, which is used to represent the influence of fabric flatness and external factors on pigment convection. The external factors include gravity, wind force and electromagnetic force. R() is a function of pigment concentration and temperature, which is used to simulate the chemical reaction between pigments. i (C,T) represents the chemical reaction rate of the i-th pigment;

[0117] The partial differential equation, the two-dimensional diffusion equation and the three-dimensional diffusion equation are converted into a physical loss function and embedded in the PINN network model. The physical loss function is expressed as:

[0118]

[0119] The solution of physical information is introduced into the generator by minimizing the physical loss function, and the generated pattern that satisfies the physical diffusion principle is output.

[0120] 103. Using the data set to train the PINN network model;

[0121] As an optional implementation, in the first aspect of the present invention, the adopting the data set to train the PINN network model comprises:

[0122] Get the generated pattern data distribution p of the generator G (X) and the data distribution p of the real patterns in the dataset data (X);

[0123] Based on the data distribution p of the generated pattern G (X) and the data distribution p of the true pattern data The divergence distance between (X) is minimized to determine the approximate solution of the real pattern data output by the PINN network model. During the model training process, the network parameters of the model are adjusted by the adversarial loss function of the generator and the binary cross entropy loss function of the discriminator. The adversarial loss function of the generator without introducing physical information is expressed as:

[0124]

[0125] The discriminator binary cross entropy loss function without introducing physical information is expressed as:

[0126]

[0127] After introducing physical information for training based on the physical loss function embedded in the PINN network model, the hyperparameter λ is added to adjust the weight between the adversarial network loss function and the physical loss function. The expression of the generator loss function is:

[0128] L G =L G′ +λL p

[0129] The expression of the discriminator loss function is:

[0130] L D =L D′ +L G

[0131] The objective function of the PINN network model is expressed as:

[0132]

[0133] Inputting the data set into the PINN network model to alternately train the discriminator and the generator;

[0134] When training the discriminator, the data distribution p of the real pattern data (X) extracts real patterns and random vectors A to perform model training until the objective function is maximized;

[0135] When training the generator, the data distribution p of the real pattern data (X) extracts a random vector and a feature constant E and inputs them into the model training until the objective function is minimized;

[0136] The PINN network model is continuously updated through forward propagation and back propagation.

[0137] 104. Generate a tie-dye pattern using the trained PINN network model, and perform similarity evaluation on the tie-dye pattern according to an evaluation index.

[0138] As an optional implementation, in the first aspect of the present invention, the similarity evaluation of the tie-dye pattern according to the evaluation index comprises:

[0139] The evaluation indicators are determined to be FID value and PPL value, and the calculation expression of FID value is:

[0140] FID 2 =||μ1-μ2|| 2 +Tr(C1+C2-2(C1C2) 1 / 2 )

[0141] Where μ1 and μ2 are the mean vectors of the true pattern and the generated pattern, respectively; C1 and C2 are the covariance matrices of the true pattern and the generated pattern, respectively; Tr is the trace of the matrix;

[0142] The calculation expression of the PPL value is:

[0143]

[0144] Among them, E G It is expressed as the expected value of the square of all the pattern gradients generated by the generator, Represented as the gradient of each generated pattern in the feature space;

[0145] The difference between the generated pattern and the real pattern is determined based on the F ID value, and the authenticity of the generated pattern is determined based on the balance of the PPL value in analyzing the change of the generated pattern in the feature space, and the similarity between the generated pattern and the real pattern is comprehensively determined according to the difference and the authenticity.

[0146] Based on the PINN network model, the diffusion and reaction of dyes on fabrics are simulated, and a variety of possible pattern designs can be quickly generated. It can simulate complex physical processes, such as the influence of dye permeability, temperature and proportion on the dyeing effect, thereby generating more accurate and consistent tie-dye patterns, which helps to reduce the cost of experiments and trial and error and improve the quality of patterns. The introduction of the PINN neural network adds the factor of physical interaction between fabrics and dyes in the simulation of tie-dyeing, further increasing the diversity and creativity of tie-dye patterns, and can generate richer tie-dye pattern designs, which can be widely used in clothing, bed sheets, tablecloths, curtains, wall hangings, shoulder bags, coasters and other fields with high demands for design sense.

[0147] like Figure 2 As shown, the second aspect of the present invention discloses a tie-dye stylized pattern generation system based on a PINN network, the system comprising:

[0148] A data collection module is used to collect tie-dye patterns for pre-processing and obtain pattern data sets;

[0149] A model building module is used to build a PINN network model, wherein the model introduces tie-dyeing physical information;

[0150] A model training module, used for training the PINN network model using the data set;

[0151] The output evaluation module is used to generate a tie-dye pattern using the trained PI NN network model and perform similarity evaluation on the tie-dye pattern according to the evaluation index.

[0152] The third aspect of the present invention discloses a device for generating a tie-dye stylized pattern based on a PINN network, comprising:

[0153] at least one processor, and

[0154] a memory communicatively connected to the at least one processor; wherein,

[0155] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for generating tie-dye stylized patterns based on a PINN network as disclosed in any one of the first aspects of the present invention.

[0156] The computer device may be a terminal, and the computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for generating a tie-dye stylized pattern based on a PINN network is implemented. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or a key, a trackball or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.

[0157] The fourth aspect of the present invention discloses a computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the PINN network-based tie-dye stylized pattern generation method as described in any one of the first aspect of the present invention.

[0158] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods for generating tie-dye stylized patterns based on the PINN network. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0159] Alternatively, if the above modules of the present invention are implemented in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, terminal, or network device, etc.) to execute all or part of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, RAM, ROM, magnetic disks or optical disks.

[0160] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0161] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0162] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0163] Finally, it should be noted that the method and system for generating tie-dye stylized patterns based on a PI NN network disclosed in the embodiment of the present invention only disclose the preferred embodiments of the present invention, which are only used to illustrate the technical solutions of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features thereof can be replaced by equivalents. However, 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 various embodiments of the present invention.

Claims

1. A method for generating tie-dye stylized patterns based on a PINN network, characterized in that: The method comprises: Collect tie-dye patterns for preprocessing and obtain pattern data sets; Constructing a PINN network model, wherein the model introduces tie-dyeing physical information; Using the data set to train the PINN network model; The trained PINN network model is used to generate a tie-dye pattern, and the tie-dye pattern is evaluated for similarity according to an evaluation index.

2. The method for generating tie-dye stylized patterns based on a PINN network according to claim 1, characterized in that: The PINN network model includes a generator for generating patterns and a discriminator for outputting pattern labels, wherein the input of the generator is the constant features and random features of the patterns in the data set, and the input of the discriminator is the sample patterns in the data set and the generated patterns output by the generator; The generator includes a plurality of fully connected layers and convolutional layers, wherein the fully connected layers are spaced apart from the convolutional layers, the fully connected layers decouple the input random vectors to obtain feature vectors with physical information, the convolutional layers perform incremental training on the input constant features through upsampling and feature learning, and generate tie-dye patterns based on the feature vectors with physical information and the constant features of feature learning through adaptive normalization fusion; The discriminator includes several convolutional layers and two fully connected layers. The convolutional layers extract features of the input generated patterns and sample patterns by increasing the number of channels, and every two convolutional layers are divided into a group for downsampling at different scales. The fully connected layer outputs a category label for the pattern after feature extraction and downsampling by the convolutional layer. The category label is used to represent the relationship between the output pattern, the generated pattern and the real pattern.

3. The method for generating tie-dye stylized patterns based on a PINN network according to claim 2, characterized in that: The pattern generation step of the PINN network model includes: A constant feature matrix E in the data set and a random vector A~p(A) obeying uniform distribution are input into the PINN network model, wherein the relationship between the input and output of the PINN network model is expressed as: X=G(A,E), X represents the generated pattern of the output; The input random vector A~p(A) is decoupled and converted into a decoupled feature P′=MLP(A) through N fully connected layers and activation functions to reduce the correlation and dependence between features. The number of neurons in each layer of the fully connected layer is the same, and the size and shape of the input random vector A and the output decoupled feature P′ are the same. The output formula of the nth fully connected layer among the N fully connected layers is expressed as: M (n) =σ (n) (W (n) M (n-1) +B (n) ),n=(1,2,3,…N) Where N represents the maximum number of fully connected layers, n represents the nth fully connected layer among N fully connected layers, and M (n) represents the decoupled feature P′ output by the nth fully connected layer, MLP(A) represents the transformation operation of the random vector A through the fully connected layer and the activation function, and W (n) represents the weight matrix of the nth fully connected layer, B (n) represents the bias matrix of the nth fully connected layer, σ (n) represents the activation function of the nth fully connected layer, M (n-1) represents the decoupled feature P′ output by the n-1th fully connected layer, then M (0) A represents the random vector A of the initial input model; The physical diffusion of the two-dimensional plane is introduced into the decoupling feature P′, and the physical information is given to the decoupling feature P′ to obtain the physical feature P. The output formula of the physical feature P is expressed as: Pf d (P′)P′+α·g(C) Among them, P′ represents the decoupled features of the fully connected layer output, f d () represents the physical diffusion expression, α represents the weight parameter, C represents the two-dimensional diffusion equation, and g(C) represents the adjustment amount of the physical diffusion calculation.

4. The method for generating tie-dye stylized patterns based on a PINN network according to claim 3, characterized in that: The pattern generation step of the PINN network model includes: The input constant feature E is upsampled and feature learned by an L-layer convolutional neural network consisting of two convolutional layers to generate a pattern X i , the relationship of the upsampling process is expressed as: X i =FSC(X i-1 ), where X i represents the feature pattern after upsampling at the i-th layer, X i-1 represents the feature pattern before upsampling of the i-th layer, and FSC() represents the fractional stride convolution of the convolutional neural network; The physical features P are fused by embedding an adaptive normalization layer between the convolutional layers to retain the pattern features and optimize the pattern quality. The expression of the adaptive normalization layer is: Among them, X i-1 represents the feature pattern of the input i-th convolutional layer, X i represents the characteristic pattern output by the i-th convolutional layer, μ(P) represents the mean of the physical feature, σ(P) represents the variance of the physical feature, and μ(X i-1 ) represents the mean of the input feature pattern of the i-th convolutional layer, σ(X i-1 ) represents the variance of the input feature pattern of the i-th convolutional layer, AdaIN() represents the adaptive normalization function; The discriminator takes the generated pattern X and the pattern dataset output by the generator as input, and outputs the label Y corresponding to the pattern through the convolutional layer and the fully connected layer. The expression of the label Y is: Y = D(X), where D() represents the label recognition processing.

5. The method for generating tie-dye stylized patterns based on a PINN network according to claim 4, characterized in that: The model introduces tie-dye physics information, including: A two-dimensional diffusion equation is used to simulate the modeling process of pigment diffusion and mixing. The partial differential equation describing the physical phenomenon is determined according to the factors of tie-dye pigment diffusion and mixing. The two-dimensional diffusion equation is expressed as: Among them, C is specifically expressed as C(x,y,t), C(x,y,t) represents the pigment concentration at the (x,y) position in the two-dimensional plane and at time t, and D represents the diffusion coefficient of the pigment on the cloth; The change of pigment concentration over time and the diffusion relationship of pigment in space are added to the simulation process, and the concentration C at point (i, j) on the two-dimensional plane is calculated by the discrete form of the two-dimensional diffusion equation as follows: in, represents the concentration of the pigment at point (i, j) at time step n, represents the concentration of the pigment at point (i, j) at time step n+1, Δx represents the coordinate difference between point (i+1, j) and point (i, j) in the x direction of the two-dimensional plane, Δy represents the coordinate difference between point (i+1, j) and point (i, j) in the y direction of the two-dimensional plane, i represents the coordinate position in the x direction of the two-dimensional plane, and j represents the coordinate position in the y direction of the two-dimensional plane; According to the effect of increasing the thickness of the cloth on the diffusion and mixing of the pigment, the texture property, water absorption property and temperature property of the cloth are introduced to extend the two-dimensional diffusion simulation to the three-dimensional diffusion simulation. The three-dimensional diffusion equation is expressed as: Where T represents temperature, C i represents the concentration of the i-th pigment at the position (x, y, z) at time t, S(T, texture) represents the water absorption coefficient of the fabric, and D i (S(T, texture)) represents the diffusion coefficient of the i-th pigment, u is the convection velocity vector, which is used to represent the influence of fabric flatness and external factors on pigment convection. The external factors include gravity, wind force and electromagnetic force, and R() is a function of pigment concentration and temperature. Used to simulate the chemical reaction between pigments, R i (C,T) represents the chemical reaction rate of the i-th pigment; The partial differential equation, the two-dimensional diffusion equation and the three-dimensional diffusion equation are converted into a physical loss function and embedded in the PINN network model. The physical loss function is expressed as: The solution of physical information is introduced into the generator by minimizing the physical loss function, and the generated pattern that satisfies the physical diffusion principle is output.

6. The method for generating tie-dye stylized patterns based on a PINN network according to claim 5, characterized in that: The adopting the data set to train the PINN network model comprises: Get the generated pattern data distribution p of the generator G (X) and the data distribution p of the real patterns in the dataset data (X); Based on the data distribution p of the generated pattern G (X) and the data distribution p of the true pattern data The divergence distance between (X) is minimized to determine the approximate solution of the real pattern data output by the PINN network model. During the model training process, the network parameters of the model are adjusted by the adversarial loss function of the generator and the binary cross entropy loss function of the discriminator. The adversarial loss function of the generator without introducing physical information is expressed as: The discriminator binary cross entropy loss function without introducing physical information is expressed as: After introducing physical information for training based on the physical loss function embedded in the PINN network model, the hyperparameter λ is added to adjust the weight between the adversarial network loss function and the physical loss function. The expression of the generator loss function is: The expression of the discriminator loss function is: L D =L D′ +L G The objective function of the PINN network model is expressed as: Inputting the data set into the PINN network model to alternately train the discriminator and the generator; When training the discriminator, the data distribution p of the real pattern data (X) extracts real patterns and random vectors A to perform model training until the objective function is maximized; When training the generator, the data distribution p of the real pattern data (X) extracts a random vector and a feature constant E and inputs them into the model training until the objective function is minimized; The PINN network model is continuously updated through forward propagation and back propagation.

7. The method for generating tie-dye stylized patterns based on a PINN network according to claim 6, characterized in that: The performing similarity evaluation on the tie-dye pattern according to the evaluation index comprises: The evaluation indicators are determined to be FID value and PPL value, and the calculation expression of FID value is: FID 2 =||μ1-μ2|| 2 +Tr(C1+C2-2(C1C2) 1 / 2 ) Where μ1 and μ2 are the mean vectors of the true pattern and the generated pattern, respectively; C1 and C2 are the covariance matrices of the true pattern and the generated pattern, respectively; Tr is the trace of the matrix; The calculation expression of the PPL value is: Among them, E G It is expressed as the expected value of the square of all the pattern gradients generated by the generator, Represented as the gradient of each generated pattern in the feature space; The difference between the generated pattern and the real pattern is determined based on the FID value, and the authenticity of the generated pattern is determined based on the balance of the PPL value in analyzing the change of the generated pattern in the feature space. The similarity between the generated pattern and the real pattern is comprehensively determined based on the difference and the authenticity.

8. A tie-dye stylized pattern generation system based on PINN network, characterized in that: The system comprises: A data collection module is used to collect tie-dye patterns for pre-processing and obtain pattern data sets; A model building module is used to build a PINN network model, wherein the model introduces tie-dyeing physical information; A model training module, used for training the PINN network model using the data set; The output evaluation module is used to generate a tie-dye pattern using the trained PINN network model, and perform similarity evaluation on the tie-dye pattern according to the evaluation index.

9. A device for generating tie-dye stylized patterns based on a PINN network, characterized in that: include: at least one processor, and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for generating tie-dye stylized patterns based on a PINN network according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method for generating a tie-dye stylized pattern based on a PINN network as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Digital tie-dyeing pattern generation method based on deep learning and digital image processing

    CN111260755A

  • Data-driven representation and clustering discretization method and system for design optimization and / or performance prediction of material systems and applications of same

    CN113168891A

  • Urban scene analogue simulation system

    CN115470707A

  • Symmetrical lace image generation method based on generative adversarial network

    CN117392258A

  • Bridge structure three-dimensional damage identification method

    CN118731179A