A method and system for generating tie-dye stylized patterns based on PINN networks

By using a tie-dye stylized pattern generation method based on PINN networks to simulate the diffusion and reaction of dyes on fabrics, the problem of insufficient accuracy and consistency of tie-dye patterns in existing technologies is solved, and higher quality tie-dye pattern generation is achieved, which is suitable for a variety of decorative designs.

CN119379848BActive Publication Date: 2025-10-31GUANGDONG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing tie-dye pattern generation methods do not consider the physical interaction between dye and fabric, resulting in insufficient accuracy and consistency of the generated tie-dye patterns.

Method used

A tie-dye stylized pattern generation method based on PINN network is adopted. By constructing a PINN network model, tie-dye physical information is introduced to simulate the diffusion and reaction of dye on the fabric. The generator and discriminator are used for training to generate tie-dye patterns that conform to the physical diffusion principle.

Benefits of technology

It improves the accuracy and consistency of tie-dye patterns, reduces the cost of experimentation and trial and error, increases the diversity and creativity of tie-dye patterns, and can generate richer designs, applicable to clothing, bed sheets, tablecloths, curtains, wall hangings, handbags and other fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119379848B_ABST
    Figure CN119379848B_ABST
Patent Text Reader

Abstract

This invention proposes a method and system for generating tie-dye stylized patterns based on a PINN network. The method includes: collecting tie-dye patterns for preprocessing to obtain a pattern dataset; constructing a PINN network model, wherein the model incorporates tie-dye physical information; training the PINN network model using the dataset; generating tie-dye patterns using the trained PINN network model; and evaluating the similarity of the tie-dye patterns based on evaluation metrics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, specifically to a method and system for generating tie-dye style patterns based on PINN networks. Background Technology

[0002] The modern tie-dye technique includes hundreds of variations, each producing a unique artistic effect. For example, the "roll-on twisting" technique creates rich and natural color variations. Even with thousands of tied flowers, no two patterns will be exactly alike after dyeing. Therefore, tie-dye patterns are widely used in clothing, bed sheets, tablecloths, curtains, wall hangings, handbags, coasters, and many other fields.

[0003] With the development of digital processing technology, modern tie-dye art has 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-dye techniques are constantly innovating and developing to adapt to the aesthetic needs and lifestyles of modern society. For example, patent publication number CN111260755A discloses a digital tie-dye pattern generation method based on deep learning and digital pattern processing, which uses generative networks combined with computer pattern processing methods to obtain tie-dye patterns. However, the disclosed pattern generation method does not consider the physical interaction between dye and fabric in the actual tie-dye process. Specific factors such as dye penetration, temperature, and proportion will affect the accuracy and consistency of the generated tie-dye patterns.

[0004] Therefore, there is an urgent need for a tie-dye stylized pattern generation method based on PINN network to solve the problem that existing technologies do not consider the influence of physical interaction in generating tie-dye patterns. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention proposes a method and system for generating tie-dye stylized patterns based on PINN networks.

[0006] The first aspect of this invention discloses a method for generating tie-dye stylized patterns based on PINN networks, comprising:

[0007] Collect tie-dye patterns, perform preprocessing, and obtain a pattern dataset;

[0008] Construct a PINN network model, which incorporates tie-dye physical information;

[0009] The PINN network model was trained using the dataset described above.

[0010] Tie-dye patterns are generated using the trained PINN network model, and the similarity of the tie-dye patterns is evaluated based on the evaluation metrics.

[0011] As an optional implementation, in a first aspect of the present invention, the PINN network model includes a generator for generating patterns and a discriminator for outputting pattern labels, wherein the input to the generator is constant features and random features of patterns in the dataset, and the input to the discriminator is sample patterns in the dataset and generated patterns output by the generator.

[0012] The generator includes several fully connected layers and convolutional layers, with the fully connected layers and convolutional layers spaced apart. The fully connected layers decouple the input random vector to obtain feature vectors with physical information. The convolutional layers incrementally train the input constant features through upsampling and feature learning. Based on the feature vectors with physical information and the constant features learned through feature learning, the generator generates tie-dye patterns through adaptive normalization fusion.

[0013] The discriminator includes several convolutional layers and two fully connected layers. The convolutional layers extract features from the input generated pattern and sample pattern by increasing the number of channels, and each pair of convolutional layers is grouped together for downsampling at different scales. The fully connected layers output category labels for the pattern after feature extraction and downsampling by the convolutional layers. The category labels are used to represent the relationship between the output pattern and 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 and a random vector A ~ p(A) following a 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), where X represents the generated pattern of the output;

[0016] The input random vector A~p(A) is decoupled and transformed into a decoupling feature P′=MLP(A) through N fully connected layers and activation functions to reduce the correlation and dependence between features. Each fully connected layer has the same number of neurons, and the input random vector A and the output decoupling feature P′ have the same size and shape. The output formula of the nth fully connected layer in 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 out of N fully connected layers, and M (n)Let P′ represent the decoupling feature output by the nth fully connected layer, and MLP(A) represent the transformation operation of a random vector A through a fully connected layer and an activation function. W (n) B represents the weight matrix of the nth fully connected layer. (n) σ represents the bias matrix of the nth fully connected layer. (n) Let M represent the activation function of the nth fully connected layer. (n-1) Let P′ represent the decoupling feature P′ of the output of the (n-1)th fully connected layer, then M (0) Let A be a random vector representing the initial input model;

[0019] A two-dimensional plane physical diffusion is introduced into the decoupling feature P′, and physical information is assigned 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] Where P′ represents the decoupling feature of the fully connected layer output, f d () represents the physical diffusion expression, α represents the weighting parameter, C represents the two-dimensional diffusion equation, and g(C) represents the adjustment amount for physical diffusion calculation.

[0022] As an optional implementation, in the first aspect of the present invention, the pattern generation step of the PINN 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 as a group to generate a pattern X. i The relationship for the upsampling process is expressed as: X i =FSC(X) i-1 ), where X i X represents the feature pattern after upsampling at the i-th layer. i-1 This represents the feature pattern before upsampling at the i-th layer, and FSC() represents fractional stride convolution in a convolutional neural network.

[0024] By embedding an adaptive layer-wise normalization between convolutional layers to fuse physical features P in order to preserve pattern features and optimize pattern quality, the expression for adaptive layer-wise normalization is:

[0025]

[0026] Among them, X i-1 X represents the feature pattern of the input i-th convolutional layer. i Let μ(P) represent the feature pattern output by the i-th convolutional layer, μ(P) represent the mean of the physical features, σ(P) represent the variance of the physical features, and μ(X) represent the variance of the physical features. 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, and 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 convolutional layers and fully connected layers. The expression of label Y is: Y = D(X), where D() represents label recognition processing.

[0028] As an optional implementation, in a first aspect of the invention, the model incorporates tie-dye physical information, including:

[0029] A two-dimensional diffusion equation is used to model the diffusion and mixing process of pigments. Based on the factors affecting the diffusion and mixing of tie-dye pigments, a partial differential equation describing the physical phenomena is determined. The two-dimensional diffusion equation is expressed as follows:

[0030]

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

[0032] By incorporating the changes in pigment concentration over time and the spatial diffusion relationship of the pigment into the simulation process, the concentration C at point (i,j) on the two-dimensional plane is calculated using the discrete form of the two-dimensional diffusion equation, expressed as:

[0033]

[0034] in, This represents the concentration of the pigment at point (i,j) at time step n. Δx represents the concentration of pigment at point (i,j) at time step n+1, Δx represents the difference in coordinates between point (i+1,j) and point (i,j) in the x-direction of the two-dimensional plane, Δy represents the difference in coordinates 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] Based on the effect of increasing fabric thickness on pigment diffusion and mixing, the fabric's texture, water absorption, and temperature properties are introduced to extend the two-dimensional diffusion simulation to a three-dimensional diffusion simulation. The three-dimensional diffusion equation is expressed as:

[0036]

[0037] Where T represents temperature, C iLet S(T,texture) represent the concentration of the i-th pigment at position (x,y,z) at time t, and D represent the water absorption coefficient of the fabric. i (S(T,texture)) represents the diffusion coefficient of the i-th pigment, u is the convection velocity vector, used to represent the influence of fabric smoothness 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 chemical reactions between pigments, R i (C,T) represents the chemical reaction rate of the i-th pigment;

[0039] The partial differential equations, two-dimensional diffusion equations, and three-dimensional diffusion equations are transformed into physical loss functions and embedded into the PINN network model. The physical loss function is expressed as follows:

[0040]

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

[0042] As an optional implementation, in the first aspect of the invention, training the PINN network model using the dataset includes:

[0043] Obtain the generated pattern data distribution p from 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 of the real pattern p data The minimum divergence distance between (X) determines the approximate solution of the real pattern data output by the PINN network model. During model training, 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's binary cross-entropy loss function, without incorporating physical information, is expressed as:

[0047]

[0048] After incorporating physical information into the physical loss function based on the embedded PINN network model during training, and adding a hyperparameter λ to adjust the weights between the adversarial network loss function and the physical loss function, the generator loss function is expressed as follows:

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

[0050] The discriminator loss function is expressed as follows:

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

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

[0053]

[0054] The dataset is input into the PINN network model to train the discriminator and generator alternately.

[0055] During the training of the discriminator, the data distribution p of the real pattern... data (X) is used to extract real patterns and random vectors A to train the model until the objective function is maximized;

[0056] During generator training, the data distribution p of the real pattern... data Random vectors and feature constants E are extracted from (X) and input into the model for training until the objective function is minimized;

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

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

[0059] The evaluation indicators are determined to be the FID value and the PPL value. The formula for calculating the FID value is as follows:

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

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

[0062] The expression for calculating the PPL value is:

[0063]

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

[0065] The degree of difference between the generated pattern and the real pattern is determined based on the FID value, and the realism of the generated pattern is determined based on the balance of the changes of the generated pattern in the feature space based on the PPL value. The similarity between the generated pattern and the real pattern is judged comprehensively based on the degree of difference and the realism.

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

[0067] The data acquisition module is used to collect tie-dye patterns for preprocessing and to obtain a pattern dataset.

[0068] A model building module is used to build a PINN network model, which incorporates tie-dye physical information;

[0069] The model training module is used to train the PINN network model using the dataset.

[0070] The output evaluation module is used to generate tie-dye patterns using the trained PI NN network model and to evaluate the similarity of the tie-dye patterns according to the evaluation index.

[0071] A third aspect of this invention discloses a tie-dye stylized pattern generation device 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, which, when executed by the at least one processor, enables the at least one processor to perform a tie-dye stylized pattern generation method based on a PINN network as disclosed in any of the first aspects of the present invention.

[0075] The fourth aspect of the present invention discloses a computer-readable storage medium storing computer-executable instructions for causing a computer to perform a tie-dye stylized pattern generation method based on a PINN network as disclosed in any of the first aspects of the present invention.

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

[0077] This invention simulates the diffusion and reaction of dyes on fabrics based on the PINN network model, rapidly generating a variety of possible pattern designs. It can simulate complex physical processes, such as the influence of dye penetration, temperature, and proportion on the dyeing effect, thereby generating more accurate and consistent tie-dye patterns. This helps 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 fabric and dye in the simulated tie-dyeing, further increasing the diversity and creativity of tie-dye patterns. It can generate richer tie-dye pattern designs and can be widely used in fields with high demand for design, such as clothing, bed sheets, tablecloths, curtains, wall hangings, handbags, and coasters. Attached Figure Description

[0078] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0079] Figure 1 This is a flowchart of the tie-dye stylized pattern generation method based on PINN network of the present invention;

[0080] Figure 2 This is a schematic diagram of the tie-dye stylized pattern generation system based on PINN network of the present invention. Detailed Implementation

[0081] To make the objectives, technical solutions, and advantages of this application clearer, the application is described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.

[0082] Obviously, the accompanying drawings described below are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar scenarios based on these drawings without any inventive effort. Furthermore, it is understood that although the efforts made in this development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this application, any changes to design, manufacturing, or production based on the technical content disclosed in this application are merely conventional technical means and should not be construed as insufficient disclosure of the content of this application.

[0083] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment that is mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.

[0084] Unless otherwise defined, the technical or scientific terms used in this application shall have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms “a,” “an,” “an,” “the,” and similar words used in this application do not indicate quantity limitation and may indicate singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; 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 not listed, or may include other steps or units inherent to these processes, methods, products, or devices. The terms “connected,” “linked,” “coupled,” and similar words used in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. “Multiple” used in this application refers to two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following objects are in an "or" relationship. The terms "first," "second," and "third" used in this application are merely to distinguish similar objects and do not represent a specific ordering of the objects.

[0085] Example 1

[0086] See Figure 1 This invention discloses a method for generating tie-dye stylized patterns based on PINN networks, comprising:

[0087] 101. Collect tie-dye patterns, perform preprocessing, and obtain pattern datasets;

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

[0089] 102. Construct a PINN network model, which incorporates tie-dye physical information;

[0090] As an optional implementation, in a first aspect of the present invention, the PINN network model includes a generator for generating patterns and a discriminator for outputting pattern labels, wherein the input to the generator is constant features and random features of patterns in the dataset, and the input to the discriminator is sample patterns in the dataset and generated patterns output by the generator.

[0091] The generator includes several fully connected layers and convolutional layers, with the fully connected layers and convolutional layers spaced apart. The fully connected layers decouple the input random vector to obtain feature vectors with physical information. The convolutional layers incrementally train the input constant features through upsampling and feature learning. Based on the feature vectors with physical information and the constant features learned through feature learning, the generator generates tie-dye patterns through adaptive normalization fusion.

[0092] The discriminator includes several convolutional layers and two fully connected layers. The convolutional layers extract features from the input generated pattern and sample pattern by increasing the number of channels, and each pair of convolutional layers is grouped together for downsampling at different scales. The fully connected layers output category labels for the pattern after feature extraction and downsampling by the convolutional layers. The category labels are used to represent the relationship between the output pattern and 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 and a random vector A ~ p(A) following a 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), where X represents the generated pattern of the output;

[0095] The input random vector A~p(A) is decoupled and transformed into a decoupling feature P′=MLP(A) through N fully connected layers and activation functions to reduce the correlation and dependence between features. Each fully connected layer has the same number of neurons, and the input random vector A and the output decoupling feature P′ have the same size and shape. The output formula of the nth fully connected layer in 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 out of N fully connected layers, and M (n)Let P′ represent the decoupling feature output by the nth fully connected layer, and MLP(A) represent the transformation operation of a random vector A through a fully connected layer and an activation function. W (n) B represents the weight matrix of the nth fully connected layer. (n) σ represents the bias matrix of the nth fully connected layer. (n) Let M represent the activation function of the nth fully connected layer. (n-1) Let P′ represent the decoupling feature P′ of the output of the (n-1)th fully connected layer, then M (0) Let A be a random vector representing the initial input model;

[0098] A two-dimensional plane physical diffusion is introduced into the decoupling feature P′, and physical information is assigned 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] Where P′ represents the decoupling feature of the fully connected layer output, f d () represents the physical diffusion expression, α represents the weighting parameter, C represents the two-dimensional diffusion equation, and g(C) represents the adjustment amount for 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 as a group to generate a pattern X. i The relationship for the upsampling process is expressed as: X i =FSC(X) i-1 ), where X i X represents the feature pattern after upsampling at the i-th layer. i-1 This represents the feature pattern before upsampling at the i-th layer, and FSC() represents fractional stride convolution in a convolutional neural network.

[0103] By embedding an adaptive layer-wise normalization between convolutional layers to fuse physical features P in order to preserve pattern features and optimize pattern quality, the expression for adaptive layer-wise normalization is:

[0104]

[0105] Among them, X i-1 X represents the feature pattern of the input i-th convolutional layer. i Let μ(P) represent the feature pattern output by the i-th convolutional layer, μ(P) represent the mean of the physical features, σ(P) represent the variance of the physical features, and μ(X) represent the variance of the physical features. 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, and 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 convolutional layers and fully connected layers. The expression of label Y is: Y = D(X), where D() represents label recognition processing.

[0107] As an optional implementation, in a first aspect of the invention, the model incorporates tie-dye physical information, including:

[0108] A two-dimensional diffusion equation is used to model the diffusion and mixing process of pigments. Based on the factors affecting the diffusion and mixing of tie-dye pigments, a partial differential equation describing the physical phenomena is determined. The two-dimensional diffusion equation is expressed as follows:

[0109]

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

[0111] By incorporating the changes in pigment concentration over time and the spatial diffusion relationship of the pigment into the simulation process, the concentration C at point (i,j) on the two-dimensional plane is calculated using the discrete form of the two-dimensional diffusion equation, expressed as:

[0112]

[0113] in, This represents the concentration of the pigment at point (i,j) at time step n. Δx represents the concentration of pigment at point (i,j) at time step n+1, Δx represents the difference in coordinates between point (i+1,j) and point (i,j) in the x-direction of the two-dimensional plane, Δy represents the difference in coordinates 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] Based on the effect of increasing fabric thickness on pigment diffusion and mixing, the fabric's texture, water absorption, and temperature properties are introduced to extend the two-dimensional diffusion simulation to a three-dimensional diffusion simulation. The three-dimensional diffusion equation is expressed as:

[0115]

[0116] Where T represents temperature, C iLet S(T,texture) represent the concentration of the i-th pigment at position (x,y,z) at time t, and D represent the water absorption coefficient of the fabric. i (S(T,texture)) represents the diffusion coefficient of the i-th pigment, u is the convection velocity vector, used to represent the influence of fabric smoothness and external factors on pigment convection, the external factors including gravity, wind, and electromagnetic force, 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;

[0117] The partial differential equations, two-dimensional diffusion equations, and three-dimensional diffusion equations are transformed into physical loss functions and embedded into the PINN network model. The physical loss function is expressed as follows:

[0118]

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

[0120] 103. Train the PINN network model using the dataset mentioned above;

[0121] As an optional implementation, in the first aspect of the invention, training the PINN network model using the dataset includes:

[0122] Obtain the generated pattern data distribution p from 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 of the real pattern p data The minimum divergence distance between (X) determines the approximate solution of the real pattern data output by the PINN network model. During model training, 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's binary cross-entropy loss function, without incorporating physical information, is expressed as:

[0126]

[0127] After incorporating physical information into the physical loss function based on the embedded PINN network model during training, and adding a hyperparameter λ to adjust the weights between the adversarial network loss function and the physical loss function, the generator loss function is expressed as follows:

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

[0129] The discriminator loss function is expressed as follows:

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

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

[0132]

[0133] The dataset is input into the PINN network model to train the discriminator and generator alternately.

[0134] During the training of the discriminator, the data distribution p of the real pattern... data (X) is used to extract real patterns and random vectors A to train the model until the objective function is maximized;

[0135] During generator training, the data distribution p of the real pattern... data Random vectors and feature constants E are extracted from (X) and input into the model for training until the objective function is minimized;

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

[0137] 104. Generate tie-dye patterns using the trained PINN network model, and evaluate the similarity of the tie-dye patterns according to the evaluation metrics.

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

[0139] The evaluation indicators are determined to be the FID value and the PPL value. The formula for calculating the FID value is as follows:

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

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

[0142] The expression for calculating the PPL value is:

[0143]

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

[0145] The degree of difference between the generated pattern and the real pattern is determined based on the FID value, and the realism of the generated pattern is determined based on the balance of the changes in the generated pattern in the feature space based on the PPL value. The similarity between the generated pattern and the real pattern is then judged comprehensively based on the degree of difference and the realism.

[0146] Based on the PINN network model, the diffusion and reaction of dyes on fabrics are simulated to quickly generate a variety of possible pattern designs. It can simulate complex physical processes, such as the influence of dye penetration, temperature, and ratio on the dyeing effect, thereby generating more accurate and consistent tie-dye patterns. This helps 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 fabric and dye in the tie-dye simulation, further increasing the diversity and creativity of tie-dye patterns. It can generate richer tie-dye pattern designs and can be widely used in fields with high demand for design, such as clothing, bed sheets, tablecloths, curtains, wall hangings, handbags, and coasters.

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

[0148] The data acquisition module is used to collect tie-dye patterns for preprocessing and to obtain a pattern dataset.

[0149] A model building module is used to build a PINN network model, which incorporates tie-dye physical information;

[0150] The model training module is used to train the PINN network model using the dataset.

[0151] The output evaluation module is used to generate tie-dye patterns using the trained PI NN network model and to evaluate the similarity of the tie-dye patterns according to the evaluation index.

[0152] A third aspect of this invention discloses a tie-dye stylized pattern generation device 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, which, when executed by the at least one processor, enables the at least one processor to perform a tie-dye stylized pattern generation method based on a PINN network as disclosed in any of the first aspects of the present invention.

[0156] The computer device can be a terminal, comprising a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a tie-dye style pattern generation method based on a PINN network. The display screen can be an LCD screen or an e-ink display screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.

[0157] The fourth aspect of the present invention discloses a computer-readable storage medium storing computer-executable instructions for causing a computer to perform a tie-dye stylized pattern generation method based on a PINN network as disclosed in any of the first aspects of the present invention.

[0158] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above for generating tie-dye styled patterns based on PINN networks. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can 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 a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0159] Alternatively, if the above-mentioned modules of the present invention are implemented as software functional 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 solutions of the embodiments of the present invention, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, terminal, or network device, etc.) to execute all or part of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, RAM, ROM, magnetic disks, or optical disks.

[0160] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

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

[0162] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0163] Finally, it should be noted that the tie-dye style pattern generation method and system based on PINN network disclosed in the embodiments of the present invention are merely preferred embodiments of the present invention and are only used to illustrate the technical solutions of the present invention, not to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating tie-dye stylized patterns based on PINN networks, characterized in that, The method includes: Collect tie-dye patterns, perform preprocessing, and obtain a pattern dataset; A PINN network model is constructed, which incorporates tie-dye physical information. The model incorporates tie-dye physical information, including: using a two-dimensional diffusion equation to simulate the modeling process of pigment diffusion and mixing; incorporating the change of pigment concentration over time and the diffusion relationship of pigment in space into the simulation process; and based on the effect of increasing fabric thickness on pigment diffusion and mixing, introducing the texture properties, water absorption properties, and temperature properties of the fabric to extend the two-dimensional diffusion simulation to a three-dimensional diffusion simulation. The PINN network model was trained using the dataset described above. Tie-dye patterns are generated using the trained PINN network model, and the similarity of the tie-dye patterns is evaluated based on the evaluation metrics. The PINN network model includes a generator for generating patterns and a discriminator for outputting pattern labels. The generator is input to constant and random features of patterns in the dataset, and the discriminator is input to sample patterns in the dataset and generated patterns output by the generator.

2. The tie-dye stylized pattern generation method based on PINN network according to claim 1, characterized in that, The generator includes several fully connected layers and convolutional layers, with the fully connected layers and convolutional layers spaced apart. The fully connected layers decouple the input random vector to obtain feature vectors with physical information. The convolutional layers incrementally train the input constant features through upsampling and feature learning. Based on the feature vectors with physical information and the constant features learned through feature learning, the generator generates tie-dye patterns through adaptive normalization fusion. The discriminator includes several convolutional layers and two fully connected layers. The convolutional layers extract features from the input generated pattern and sample pattern by increasing the number of channels, and each pair of convolutional layers is grouped together for downsampling at different scales. The fully connected layers output category labels for the pattern after feature extraction and downsampling by the convolutional layers. The category labels are used to represent the relationship between the output pattern and the generated pattern and the real pattern.

3. The tie-dye stylized pattern generation method based on PINN network according to claim 2, characterized in that, The pattern generation steps of the PINN network model include: A constant feature matrix E and a random vector A ~ p(A) following a 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), where X represents the generated pattern of the output; The input random vector A~p(A) is decoupled and transformed into a decoupling feature P' = MLP(A) through N fully connected layers and activation functions to reduce the correlation and dependence between features. Each fully connected layer has the same number of neurons, and the input random vector A and the output decoupling feature P' have the same size and shape. The output formula of the nth fully connected layer in 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 out of N fully connected layers, and M (n) Let P' represent the decoupling feature output by the nth fully connected layer, and MLP(A) represent the transformation operation of a random vector A through a fully connected layer and an activation function. W (n) B represents the weight matrix of the nth fully connected layer. (n) σ represents the bias matrix of the nth fully connected layer. (n) Let M represent the activation function of the nth fully connected layer. (n-1) Let P' represent the decoupling feature P' of the output of the (n-1)th fully connected layer, then M (0) Let A be a random vector that represents the initial input model. A two-dimensional plane physical diffusion is introduced into the decoupling feature P', and physical information is assigned 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) Where P' represents the decoupling feature of the fully connected layer output, f d () represents the physical diffusion expression, α represents the weighting parameter, C represents the two-dimensional diffusion equation, and g(C) represents the adjustment amount for physical diffusion calculation.

4. The tie-dye stylized pattern generation method based on PINN network according to claim 3, characterized in that, The pattern generation steps of the PINN network model include: The input constant feature E is upsampled and feature learned by an L-layer convolutional neural network consisting of two convolutional layers as a group to generate a pattern X. i The relationship for the upsampling process is expressed as: X i =FSC(X) i-1 ), where X i X represents the feature pattern after upsampling at the i-th layer. i-1 This represents the feature pattern before upsampling at the i-th layer, and FSC() represents fractional stride convolution in a convolutional neural network. By embedding an adaptive layer-wise normalization between convolutional layers to fuse physical features P in order to preserve pattern features and optimize pattern quality, the expression for adaptive layer-wise normalization is: Among them, X i-1 X represents the feature pattern of the i-th convolutional layer. i Let μ(P) represent the feature pattern output by the i-th convolutional layer, μ(P) represent the mean of the physical features, σ(P) represent the variance of the physical features, and μ(X) represent the variance of the physical features. 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, and 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 convolutional layers and fully connected layers. The expression of label Y is: Y = D(X), where D() represents label recognition processing.

5. The tie-dye stylized pattern generation method based on PINN network according to claim 4, characterized in that, The model incorporates tie-dye physical information, including: Based on the factors of dye diffusion and mixing, a partial differential equation describing the physical phenomenon is determined. The two-dimensional diffusion equation is expressed as: Where C is specifically represented as C(x,y,t), C(x,y,t) represents the pigment concentration at position (x,y) in the two-dimensional plane and time t, and D represents the diffusion coefficient of the pigment on the fabric; The concentration C at point (i,j) in the two-dimensional plane is calculated using the discrete form of the two-dimensional diffusion equation as follows: in, This represents the concentration of the pigment at point (i,j) at time step n. Δx represents the concentration of pigment at point (i,j) at time step n+1, Δx represents the difference in coordinates between point (i+1,j) and point (i,j) in the x-direction of the two-dimensional plane, Δy represents the difference in coordinates 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. The three-dimensional diffusion equation is expressed as: Where T represents temperature, C i S(T,texture) represents the concentration of the i-th pigment at position (x,y,z) at time t, and D represents the water absorption coefficient of the fabric. i (S(T,texture)) represents the diffusion coefficient of the i-th pigment, u is the convection velocity vector, used to represent the influence of fabric smoothness and external factors on pigment convection, the external factors including gravity, wind, and electromagnetic force, 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 equations, two-dimensional diffusion equations, and three-dimensional diffusion equations are transformed into physical loss functions and embedded into the PINN network model. The physical loss function is expressed as follows: By minimizing the physical loss function, the solution of physical information is introduced into the generator, and the generated pattern that satisfies the physical diffusion principle is output.

6. The tie-dye stylized pattern generation method based on PINN network according to claim 5, characterized in that, The step of training the PINN network model using the dataset includes: Obtain the generated pattern data distribution p from 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 of the real pattern p data The minimum divergence distance between (X) determines the approximate solution of the real pattern data output by the PINN network model. During model training, 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's binary cross-entropy loss function, without incorporating physical information, is expressed as: After incorporating physical information into the physical loss function based on the embedded PINN network model during training, and adding a hyperparameter λ to adjust the weights between the adversarial network loss function and the physical loss function, the generator loss function is expressed as follows: THE G =L G' +λL p The discriminator loss function is expressed as follows: L D L D' +L G The objective function of the PINN network model is expressed as: The dataset is input into the PINN network model to train the discriminator and generator alternately. During the training of the discriminator, the data distribution p of the real pattern... data (X) is used to extract real patterns and random vectors A to train the model until the objective function is maximized; During generator training, the data distribution p of the real pattern... data Random vectors and feature constants E are extracted from (X) and input into the model for training until the objective function is minimized; The PINN network model is continuously updated through forward and backward propagation.

7. The tie-dye stylized pattern generation method based on PINN network according to claim 6, characterized in that, The similarity assessment of the tie-dye patterns based on evaluation metrics includes: The evaluation indicators are determined to be the FID value and the PPL value. The formula for calculating the FID value is as follows: FID 2 =||μ1-μ2|| 2 +Tr(C1+C2-2(C1C2) 1 / 2 ) Where μ1 and μ2 are the mean vectors of the real pattern and the generated pattern, respectively, C1 and C2 are the covariance matrices of the real pattern and the generated pattern, respectively, and Tr is the trace of the matrix. The expression for calculating the PPL value is: Among them, E G It is expressed as the expected value of the square of the gradient of all patterns generated by the generator. This represents the gradient of each generated pattern in the feature space; The degree of difference between the generated pattern and the real pattern is determined based on the FID value, and the realism of the generated pattern is determined based on the balance of the changes of the generated pattern in the feature space based on the PPL value. The similarity between the generated pattern and the real pattern is judged comprehensively based on the degree of difference and the realism.

8. A tie-dye stylized pattern generation system based on PINN network, characterized in that, The system includes: The data acquisition module is used to collect tie-dye patterns for preprocessing and to obtain a pattern dataset. A model building module is used to build a PINN network model, which incorporates tie-dye physical information; The model training module is used to train the PINN network model using the dataset. The model incorporates tie-dye physical information, including: using a two-dimensional diffusion equation to simulate the modeling process of pigment diffusion and mixing, incorporating the change of pigment concentration over time and the diffusion relationship of pigment in space into the simulation process, and based on the effect of increasing fabric thickness on pigment diffusion and mixing, introducing the texture properties, water absorption properties, and temperature properties of the fabric to extend the two-dimensional diffusion simulation to a three-dimensional diffusion simulation. The output evaluation module is used to generate tie-dye patterns using the trained PINN network model and to evaluate the similarity of the tie-dye patterns according to the evaluation index. The PINN network model includes a generator for generating patterns and a discriminator for outputting pattern labels. The generator is input to constant and random features of patterns in the dataset, and the discriminator is input to sample patterns in the dataset and generated patterns output by the generator.

9. A tie-dye style pattern generation device based on 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 executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the tie-dye stylized pattern generation method based on the PINN network as described in 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 for causing a computer to perform the tie-dye stylized pattern generation method 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

  • Bridge structure three-dimensional damage identification method

    CN118731179A