Bamboo weaving parameter design method and system based on style generator adversarial network
Through the method based on style generator-based adversarial network, the problems of low modeling efficiency and poor clarity reduction of bamboo weaving pattern model are solved, and efficient and clear bamboo weaving image generation and parameterized model library construction are realized.
Patent Information
- Application Number
- CN202510349275.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-07-22
AI Technical Summary
In the prior art, the bamboo weaving pattern model is inefficient, and the generated bamboo weaving image has poor clarity and reduction degree.
Using the method of adversarial network based on the style generator, a data set is established by collecting and preprocessing local bamboo weaving patterns, and using the style generator to train the generator and discriminator to output local bamboo weaving images, combining divergence and characterization mean values to evaluate image quality, filter target images, perform vector pattern parameterization modeling, and establish a bamboo weaving pattern parameterization model library.
The clarity and reduction of bamboo weaving images are improved, the time for reconstruction of the model is reduced, and the efficiency is improved. An efficient bamboo weaving pattern parameterized model library is established.
Smart Images

Figure CN120354707A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of artificial intelligence technology, and specifically relates to a bamboo weaving parameter design method and system based on a style generator adversarial network. Background Art
[0002] With the development of Chinese bamboo culture over thousands of years, bamboo weaving techniques have long been integrated into people's production and life in various forms. Bamboo weaving techniques can weave bamboo strips into various items for people to use, and at the same time, different weaving techniques can present different pattern characteristics. Therefore, bamboo weaving techniques not only carry the material use function but also the aesthetic art function, and are extremely valuable intangible cultural heritages.
[0003] To protect and inherit bamboo weaving techniques, some scholars have proposed an interactive system that can simplify bamboo weaving techniques and improve the efficiency of bamboo weaving pattern design by presetting bamboo weaving patterns. Another scholar, in order to further strengthen the inheritance and innovation of bamboo furniture, uses an interactive design platform to coordinate the relationship between users, enterprises, and producers, and grasps the balance between traditional techniques and modern design through modern manufacturing techniques and parametric design.
[0004] However, the existing technologies have the following deficiencies: First, the modeling methods of the existing technologies can only be applied to specific bamboo weaving forms. When the form of the bamboo weaving object changes, re-modeling is required, which is time-consuming and inefficient. Second, although the existing research combines the GAN algorithm in deep learning with parametric modeling techniques, it performs poorly in the bamboo weaving image generation experiment. The generated bamboo weaving images are not clear, and the reduction degree is poor compared with real bamboo weaving images. Summary of the Invention
[0005] The purpose of the embodiments of this application is to provide a bamboo weaving parameter design method and system based on a style generator adversarial network, which can solve the problems of low modeling efficiency of bamboo weaving pattern models and poor clarity and reduction degree of the generated bamboo weaving images in the existing technologies.
[0006] To solve the above technical problems, this application is implemented as follows: In the first aspect, the embodiments of this application provide a bamboo weaving parameter design method based on a style generator adversarial network, and the method includes: Collect and preprocess local bamboo weaving patterns, and establish a local bamboo weaving pattern data set; Import the data set into a preset style generator adversarial network model for training to obtain a trained style generator adversarial network model; Input a preset random noise vector into the trained adversarial network model to output multiple local bamboo weaving images; Obtain a first image quality score based on the divergence of each local bamboo weaving image, where the divergence is used to obtain the clarity of the local bamboo weaving image; Obtain a second image quality score based on the representation mean of each local bamboo weaving image and the representation mean of a preset real bamboo weaving image, where the representation mean is used to obtain the restoration degree of the local bamboo weaving image and the real bamboo weaving image; Obtain the total image quality score of each local bamboo weaving image based on the first image quality score and the second image quality score; Determine multiple target local bamboo weaving images from multiple local bamboo weaving images based on the total image quality score and a preset image quality score threshold; Perform superposition processing on each target local bamboo weaving image in the up, down, left, and right directions to obtain the vector pattern of the bamboo weaving overall floor plan corresponding to each target local bamboo weaving image; Perform parametric modeling on multiple vector patterns to establish a parametric model library of bamboo weaving patterns; Obtain a three-dimensional design model of the bamboo weaving object based on the parametric model library of bamboo weaving patterns and the initial three-dimensional model of the bamboo weaving object.
[0007] As an alternative implementation manner of the first aspect of the present application, the process of collecting and preprocessing bamboo weaving patterns and establishing a bamboo weaving pattern data set includes: obtaining multiple bamboo weaving pattern samples, manually drawing and performing data enhancement processing on the bamboo weaving pattern samples in sequence to obtain multiple self-drawn images with a vector graph style, dividing each self-drawn image into multiple regions of the same size, and then performing horizontal mirror processing and vertical mirror processing on each region simultaneously to obtain mirror self-drawn images, and after combining the mirror self-drawn images, establishing a bamboo weaving pattern data set.
[0008] As an alternative implementation manner of the first aspect of the present application, the style generator adversarial network model includes a generator and a discriminator. The generator is jointly composed of a mapping network layer, an affine style transformation layer, and a synthesis network layer. The discriminator is composed of a multi-layer convolutional neural network. Among them, the mapping network layer is composed of multiple serially connected fully connected layers, the affine style transformation layer is composed of multiple serially connected affine transformation layers, and the synthesis network layer is composed of multiple serially connected convolutional layers, upsampling layers, normalization layers, and noise injection layers.
[0009] As an alternative implementation manner of the first aspect of the present application, the process of inputting a preset random noise vector into the trained adversarial network model and outputting multiple local bamboo weaving images includes: Input the preset random noise vector into the mapping network layer in the generator for mapping processing to obtain an intermediate vector; Input the intermediate vector into the affine style transformation layer in the generator for affine transformation processing to obtain a style vector; Input the style vector into the synthesis network layer of the generator, and perform convolution, upsampling, normalization, and noise injection in sequence to obtain a bamboo weaving generated image sample; Perform dimensionality reduction on the preset real bamboo weaving image sample to obtain a real bamboo weaving image sample with the same size as the bamboo weaving generated image sample; Input the real bamboo weaving image sample and the bamboo weaving generated image sample into the discriminator inside the trained adversarial network model simultaneously for feature extraction and downsampling processing to obtain multiple local bamboo weaving images.
[0010] As an optional implementation manner of the first aspect of the present application, the mathematical expression of the total score of the quality of the local bamboo weaving image is: Among them, is the first image quality score, is the second image quality score, is the total score of the quality of the local bamboo weaving image, is the probability distribution function, is the divergence, is the marginal probability, is the representation mean of the preset real bamboo weaving image, is the representation mean of the local bamboo weaving image, is the trace of the matrix, is the expectation of the local bamboo weaving image in the generation distribution.
[0011] As an optional implementation manner of the first aspect of the present application, the process of parameterizing and modeling multiple vector patterns and establishing a parameterized model library of bamboo weaving patterns includes: Import the vector map of the overall plan of the bamboo weaving into a preset plug-in to obtain the weaving angle of the overall plan of the bamboo weaving; Obtain the intersection coordinates of multiple overall plans of the bamboo weaving based on the width and weaving angle of the bamboo weaving; Calculate the curvature values of multiple intersection points based on the intersection coordinates, and screen out the intersection points less than or equal to the bending threshold from the multiple intersection point curvature values as target intersection points based on the preset bending threshold of the bamboo weaving; Connect the target intersection points to generate a bamboo weaving path, and construct a parameterized model library of bamboo weaving patterns based on the bamboo weaving path.
[0012] As an optional implementation manner of the first aspect of the present application, the process of obtaining a three-dimensional model of a bamboo weaving object design based on the parameterized model library of bamboo weaving patterns and the initial three-dimensional model of the bamboo weaving object includes: Adjust the dimensions of the initial 3D model of the bamboo woven object to obtain the initial 3D model of the bamboo woven object to be processed. After performing material rendering, lighting rendering, and scene rendering on the initial 3D model of the bamboo woven object to be processed in sequence, export the designed 3D model of the bamboo woven object.
[0013] In a second aspect, an embodiment of the present application provides a bamboo weaving parameter design system based on a style generator adversarial network. The system includes: A data preprocessing module, which is used to preprocess the local bamboo weaving pattern and establish a local bamboo weaving pattern dataset; A style generator adversarial network module, which imports the dataset into a preset style generator adversarial network model for training to obtain a trained style generator adversarial network model, and inputs a preset random noise vector into the trained adversarial network model to output multiple local bamboo weaving images; An image quality scoring module, which is used to obtain a first image quality score according to the divergence of each local bamboo weaving image, and obtain a second image quality score based on the representation mean of each local bamboo weaving image and the representation mean of a preset real bamboo weaving image; and obtain the total image quality score of each local bamboo weaving image based on the first image quality score and the second image quality score; An image screening module, which is used to determine the target local bamboo weaving image from the local bamboo weaving images according to the total image quality score and a preset image quality score threshold; An image overlay module, which is used to perform overlay processing on the target local bamboo weaving image in the up, down, left, and right directions to obtain vector patterns of multiple overall bamboo weaving floor plans; A parametric modeling module, which is used to perform parametric modeling on the vector pattern to establish a parametric model library of bamboo weaving patterns; A model export module, which is used to determine a parametric model of a bamboo weaving pattern from the parametric model library of bamboo weaving patterns and import it into the initial 3D model of the bamboo woven object to obtain the designed 3D model of the bamboo woven object.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor. When the program or instruction is executed by the processor, the steps of the method described in the first aspect are implemented.
[0015] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0016] Compared with the prior art, a bamboo weaving parameter design method based on a style generator adversarial network proposed by the present invention imports a data set into a preset style generator adversarial network model for training to obtain a trained style generator adversarial network model, and inputs a preset random noise vector into the trained adversarial network model to output multiple local bamboo weaving images. By training the preset style generator adversarial network model, the output local bamboo weaving images have higher resolution, richer diversity, and higher authenticity; the first image quality score is obtained according to the divergence of each local bamboo weaving image, and the second image quality score is obtained according to the representation mean of each local bamboo weaving image and the representation mean of a preset real bamboo weaving image, and the total image quality score is obtained based on the first image quality score and the second image quality score; then the target local bamboo weaving image is determined from the local bamboo weaving images according to the total image quality score, which takes into account both the clarity and the reduction degree of the local bamboo weaving image, achieving a balance between clarity and reduction degree; each target local bamboo weaving image is superimposed in the up, down, left, and right directions to obtain a vector pattern of the bamboo weaving overall plan corresponding to each target local bamboo weaving image; then parametric modeling is performed on multiple vector patterns to establish a parametric model library of bamboo weaving patterns, which can be conveniently called at any time in future research without re-modeling, with low time consumption and high efficiency; finally, based on the parametric model library of bamboo weaving patterns and the initial three-dimensional model of the bamboo weaving object, a three-dimensional model of the bamboo weaving object design is obtained. Designers can select different bamboo weaving pattern styles from the parametric model library of bamboo weaving patterns according to their own needs and call them into the three-dimensional model of the bamboo weaving object. The present invention can learn the existing bamboo weaving patterns through the trained style generator network. Compared with the real bamboo weaving patterns, the generated bamboo weaving patterns have high clarity and reduction degree. Parametric modeling is performed on the vector patterns of the bamboo weaving overall plan to establish a new parametric model library of bamboo weaving patterns, and different bamboo weaving pattern styles are determined from the parametric model library and called into the initial three-dimensional model of the bamboo weaving object to obtain a three-dimensional model of the bamboo weaving object design, realizing the sustainable development of traditional bamboo crafts. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a flowchart of a bamboo weaving parameter design method based on a style generator adversarial network provided by the first embodiment of the present application; Figure 2 is an internal structure diagram of the style generator adversarial network model provided by the first embodiment of the present application; Figure 3 is a partial sample diagram of bamboo weaving patterns provided by the first embodiment of the present application; Figure 4It is a sample diagram of the self-drawing part of the bamboo weaving pattern provided by the first embodiment of the present application; Figure 5 It is a sample segmentation diagram of the bamboo weaving pattern provided by the first embodiment of the present application; Figure 6 It is a sample diagram of the segmented part of the bamboo weaving pattern provided by the first embodiment of the present application; Figure 7 It is a diagram of the output results with different iteration times provided by the first embodiment of the present application; Figure 8 It is a sample diagram of the generation of a new bamboo weaving pattern provided by the first embodiment of the present application; Figure 9 It is a sample vector diagram of the new bamboo weaving pattern provided by the first embodiment of the present application; Figure 10 It is a parametric model diagram of the bamboo weaving pattern provided by the first embodiment of the present application; Figure 11 It is a design model diagram of the No. 1 bamboo woven handbag provided by the first embodiment of the present application; Figure 12 It is a design model diagram of the No. 2 bamboo woven handbag provided by the first embodiment of the present application; Figure 13 It is a design model diagram of the No. 8 bamboo woven handbag provided by the first embodiment of the present application; Figure 14 It is a three-dimensional design model diagram of the No. 1 bamboo woven handbag provided by the first embodiment of the present application; Figure 15 It is a three-dimensional design model diagram of the No. 2 bamboo woven handbag provided by the first embodiment of the present application; Figure 16 It is a three-dimensional design model diagram of the No. 8 bamboo woven handbag provided by the first embodiment of the present application; Figure 17 It is a schematic structural diagram of a bamboo weaving parameter design system based on a style generator adversarial network provided by the second embodiment of the present application. Detailed implementation manners
[0018] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0019] The terms "first", "second", etc. in the description and claims of this application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of this application can be implemented in an order other than those illustrated or described herein. In addition, "and / or" in the description and claims means at least one of the connected objects, and the character " / ", generally represents an "or" relationship between the associated objects before and after.
[0020] The following will combine the accompanying drawings and, through specific embodiments and their application scenarios, elaborate in detail on a bamboo weaving parameter design method provided by the embodiments of this application based on a style generator adversarial network.
[0021] Embodiment 1 Please refer to Figure 1 , which is a flowchart of a bamboo weaving parameter design method based on a style generator adversarial network proposed in the first embodiment of this application. The proposed method includes S01 - S11.
[0022] Step S01: Collect and preprocess local bamboo weaving patterns, and establish a local bamboo weaving pattern dataset; In step S01 of the present invention, the process of establishing the local bamboo weaving pattern dataset includes: obtaining multiple bamboo weaving pattern samples, sequentially performing manual drawing and data augmentation processing on the bamboo weaving pattern samples to obtain multiple self - drawn images with a vector graphic style, after dividing each self - drawn image into multiple regions of the same size, performing horizontal mirroring and vertical mirroring processing on each region simultaneously to obtain mirror self - drawn images, and after combining the mirror self - drawn images, establishing a bamboo weaving pattern dataset.
[0023] Please refer to Figure 3 , the local bamboo weaving patterns collected in the present invention are obtained by widely collecting bamboo weaving pattern images through on - site investigations, bamboo weaving technology magazines, and bamboo weaving production websites, and removing duplicate weaving images and blurred and hard - to - distinguish images through screening. A total of 247 bamboo weaving pattern samples have been accumulated. Since the quality of the collected bamboo weaving sample images is uneven, the background colors are uneven, and some images have a perspective effect, which is not conducive to the machine to extract bamboo weaving pattern features. It is necessary to unify the styles of the bamboo weaving image samples, eliminate different background colors and perspective effects, and provide them for machine learning training from the perspective of a front view.
[0024] The present invention uses Adobe Illustrator software to sequentially perform manual drawing and data augmentation processing on 247 bamboo weaving pattern samples to obtain multiple self - drawn images with a vector graphic style. Please refer to Figure 4Since a complete bamboo weaving pattern picture often contains different pattern features, the present invention unifies the 247 self-drawing pictures into a size of 400*400 and performs segmentation processing on the bamboo weaving pattern pictures. Figure 5 The present invention divides each bamboo weaving pattern image into 3*3 squares, including nine areas, and finally obtains 2223 bamboo weaving pattern samples. Then, the batch processing function in Photoshop software is used to mirror the 2223 bamboo weaving pattern samples, including two operations of horizontal mirroring and vertical mirroring, and a total of 8892 bamboo weaving pattern image samples are obtained. For some samples of the bamboo weaving pattern segmentation diagram of the present invention, please refer to Figure 6 ,These samples together constitute a dataset of local bamboo weaving patterns.
[0025] The present invention manually draws and data enhances the bamboo weaving pattern samples in sequence to obtain multiple self-drawn pictures with vector graphics style. This method of manually drawing bamboo weaving patterns has the following advantages: First, the pattern features are obvious, the image resolution is uniform, and there is no background interference, which is more conducive to the machine's extraction, learning and training of pattern features. Second, the style is unified, which is conducive to the unified style of the generated new style, which is convenient for designers to quickly identify and obtain; third, in the process of drawing, it can better help designers learn and understand the existing bamboo weaving techniques, so that reasonable weaving techniques can be well screened out from the new weaving images generated later.
[0026] The invention divides each bamboo weaving pattern image into 3*3 squares, including nine regions. The advantage is that the same image sample can be decomposed into multiple patterns with different characteristics for machine learning training. Since machine-generated images will greatly reduce the clarity, this method of magnifying details can generate images with low clarity, and can also ensure that the bamboo weaving pattern can be seen.
[0027] The present invention can also change the image features to a certain extent through the mirror processing method, providing rich data set support for machine learning training images.
[0028] Step S02: importing the data set into a preset style generator adversarial network model for training, and obtaining a trained style generator adversarial network model.
[0029] In step S02 of the present invention, please refer to Figure 2, the style generator adversarial network model used in the present invention includes a generator and a discriminator. The generator is jointly composed of a mapping network layer, an affine style transformation layer, and a synthesis network layer. The discriminator is composed of a multi-layer convolutional neural network. Among them, the mapping network layer is composed of multiple fully connected layers connected in series, the affine style transformation layer is composed of multiple affine transformation layers connected in series, and the synthesis network layer is composed of multiple convolutional layers, upsampling layers, normalization layers, and noise injection layers connected in series.
[0030] The present invention trains a preset style generator adversarial network model to obtain a trained style generator adversarial network model. The process is as follows: First, sample a random vector z (512×1) from a normal distribution and input it into a mapping network composed of multiple fully connected layers. After multiple transformations, an intermediate latent vector (located in the W space) is generated. The intermediate latent vector is mapped to a style vector through a learnable affine transformation to control the style features of the generated image. The generator takes a fixed constant tensor (4×4×512) as the initial input, and continuously enriches the image details through a series of convolutional operations, upsampling operations (such as 4×4→8×8→...→1024×1024), and adaptive instance normalization, and increases the naturalness and restoration degree of the image through noise injection. At the same time, the real image samples are dimension-reduced to make their sizes consistent with the generated images (such as 1024×1024), and then the generated images and real images are simultaneously input into a discriminator composed of a multi-layer convolutional neural network. The discriminator finally outputs the true or false judgment result of the image through feature extraction and downsampling. Based on the comparison result between the generated image and the real image, an adversarial loss function is used to measure the performance of the generator and the discriminator, and the parameters of the generator and the discriminator are updated respectively through backpropagation. When the parameters of the generator and the discriminator remain unchanged, the training is completed, and a trained style generator adversarial network model is obtained. The mathematical expression of the adversarial loss function used in the present invention is as shown in formula : In formula , represents the adversarial loss function, represents the score of the discriminator for real samples, represents the output of the discriminator for the generated image, represents the discriminator, represents the intensity of controlling the gradient penalty of real samples, controls the intensity of the gradient penalty of generated samples, represents the squared norm of the gradient of real samples, represents the squared norm of the gradient of generated samples.
[0031] Specifically, for the generator used in the present invention, compared with the traditional generator, a mapping network composed of 8 fully connected layers is added at the input end. The mapping network is used to input the dataset composed of local bamboo weaving patterns obtained through collection and preprocessing into the mapping network layer in the generator used in the present invention for mapping processing to obtain an intermediate vector. Moreover, the output layer and the input layer of the mapping network have the same size, both being 512*1, and the disentangled intermediate vector is transformed into a style control vector, thereby participating in and influencing the generation process of the generator. The specific influencing method adopts a style transformation method, such as the formula shown below: In the formula , represents the adaptive instance normalization operation, represents the standard deviation learned through the style vector, represents the content feature map, represents the mean of the content feature map, represents the standard deviation of the content feature map, represents the target mean learned through the style vector.
[0032] In addition, for the style generator adversarial network model used in the present invention, in order to reduce the correlation, an initial intermediate vector is generated through the mapping network. The generator in the internal structure of the used style generator adversarial network model adopts layer-by-layer style control, and each layer can control certain features of the image through different style vectors. Specifically, the generator in the internal structure of the style generator adversarial network model used in the present invention is composed of a low-resolution layer, a medium-resolution layer, and a high-resolution layer. Among them, the low-resolution layer (such as 4×4, 8×8) controls the contour and posture of the local bamboo weaving image, the medium-resolution layer (such as 16×16, 32×32) controls the shape and color of the overall local bamboo weaving image, and the high-resolution layer (such as 64×64, 128×128 and above) controls the texture and details of the local bamboo weaving image.
[0033] For example, there are two existing bamboo weaving patterns A and B with different styles. The present invention can extract low-level features from pattern A using the low-resolution layer to obtain A features, extract medium-level features from pattern B using the medium- and high-resolution layers to obtain B features, and finally combine the A features and the B features to generate a new local bamboo weaving image that mixes the style features of A and B.
[0034] The style generator adversarial network model used in the present invention, through truncation operation on the initial intermediate vector uses the initial intermediate vector The spatial distribution of and formula is shown as follows: In formula and formula , represents the truncated latent vector, represents the intermediate latent vector output by the mapping network, represents the mean of the latent vectors in the space, represents the style compression ratio, represents the latent vector sampled from the input latent space, represents sampling from the probability distribution in the latent space , represents the mapping network, represents the expectation operation, which means taking the average of all possible values.
[0035] In summary, based on the progressive training steps of the style-based generative adversarial network generator and discriminator of the present invention, the generator can more easily learn the features of bamboo weaving images at different scales, and through the truncation operation, the bamboo weaving images with different style features can be fused with each other to generate the features of bamboo weaving images with new styles, greatly improving the clarity and diversity of the generated bamboo weaving images.
[0036] Step S03: Input a preset random noise vector into the trained adversarial network model to output multiple local bamboo weaving images.
[0037] In step S03 of the present invention, the specific process of outputting multiple local bamboo weaving images includes: inputting a preset random noise vector into the mapping network layer in the generator for mapping processing to obtain an intermediate vector; inputting the intermediate vector into the affine style transformation layer in the generator for affine transformation processing to obtain a style vector; inputting the style vector into the synthesis network layer in the generator for convolution, upsampling, normalization, and noise injection in sequence to obtain a bamboo weaving generated image sample; performing dimensionality reduction processing on a preset real bamboo weaving image sample to obtain a real bamboo weaving image sample with the same size as the bamboo weaving generated image sample; inputting the real bamboo weaving image sample and the bamboo weaving generated image sample into the discriminator inside the trained adversarial network model for feature extraction and downsampling processing to obtain multiple local bamboo weaving images.
[0038] In the present invention, when the number of iterations of the preset style-based generative adversarial network generator reaches 1,000 times, the machine stops running, which also represents the end of training. By browsing a large number of generated samples, the present invention screens out 20 bamboo weaving patterns with better image generation effects, clearer contour lines, more reasonable interlacing structures of bamboo weaving patterns, and never seen before by experience, providing a source of materials for constructing a parametric model library of bamboo weaving patterns. Figure 7 Shows the output results of the bamboo weaving patterns of the present invention when the number of training times is 100 times, 200 times, 500 times, and 1,000 times respectively.
[0039] Step S04: Obtain a first image quality score based on the divergence of each of the local bamboo weaving images, where the divergence is used to obtain the clarity of the local bamboo weaving image.
[0040] In step S04 of the present invention, the divergence is used to measure the difference between probability distribution functions In image quality assessment, the divergence of the image (the divergence used in the present invention here) can be combined with the probability distribution function to objectively determine the clarity quality score of the local image (here referring to the data set composed of multiple local bamboo weaving images) as the first image quality score. The mathematical expression of the first image quality score of the present invention is as shown in the formula KL as follows: as shown: In the formula where, represents the first image quality score, represents the expectation of the local bamboo weaving image in the generated distribution, represents the divergence, represents the probability distribution function, represents the marginal probability.
[0041] In the present invention, the first image quality score can be obtained according to the divergence of each local bamboo weaving image. The higher the first image quality score, the higher the clarity and diversity of the output local bamboo weaving image when the data set is input into the trained adversarial network model.
[0042] Step S05: Obtain a second image quality score based on the representation mean of each of the local bamboo weaving images and the representation mean of the preset real bamboo weaving image, where the representation mean is used to obtain the reduction degree of the local bamboo weaving image and the real bamboo weaving image.
[0043] In step S05 of the present invention, the representation mean represents the statistical average of the image features in a specific dimension, which is used to quantify the key attribute of the image (here referring to the reduction degree), and further serves as an objective index for quality evaluation. The mathematical expression of the second image quality score of the present invention is as shown in the formula as follows: In the formula , represents the second image quality score, represents the representation mean of the preset real bamboo weaving image, represents the representation mean of the local bamboo weaving image, represents the trace of the matrix.
[0044] Step S06: Based on the first image quality score and the second image quality score, obtain the total quality score of each local bamboo weaving image.
[0045] In step S06 of the present invention, the score ranges of the first image quality score and the second image quality score are both between 0 and 100 points. The total quality score of the local bamboo weaving image is the superposition of the first image quality score and the second image quality score. Therefore, the score range of the total quality score of the local bamboo weaving image is between 0 and 200 points, and its mathematical expression is as shown in the formula as follows: In the formula , is the first image quality score, is the second image quality score, is the total quality score of the local bamboo weaving image, is the probability distribution function, is the divergence, is the marginal probability, is the representation mean of the preset real bamboo weaving image, is the representation mean of the local bamboo weaving image, is the trace of the matrix, is the expectation of the local bamboo weaving image in the generated distribution.
[0046] The first image quality score calculated by step S04 and the second image quality score calculated by step S05 of the present invention are used to obtain the total quality score of the local bamboo weaving image in step S06, which can balance the clarity and reduction degree of the generated local bamboo weaving image, so that the clarity and reduction degree of the bamboo weaving image reach the best level at the same time.
[0047] Step S07: Based on the total image quality score and a preset image quality score threshold, determine multiple target local bamboo weaving images from multiple said local bamboo weaving images.
[0048] In step S07 of the present invention, the preset image quality score threshold is 80% of the total image quality score. After calculating the total image quality score corresponding to each local bamboo weaving image, sort them from high to low, and select the local bamboo weaving images corresponding to the image quality scores exceeding the preset image quality score threshold as the target local bamboo weaving images.
[0049] The present invention screens from multiple local bamboo weaving images through the preset image quality score threshold, obtains multiple target local bamboo weaving images, reduces the workload of manual inspection, and improves the screening efficiency.
[0050] Step S08: Perform superposition processing on each said target local bamboo weaving image in the up, down, left, and right directions to obtain the vector pattern of the overall bamboo weaving plan view corresponding to each said target local bamboo weaving image.
[0051] In step S08 of the present invention, since there are many unreasonable situations in the bamboo weaving images trained by machine learning, such as: distorted shapes, chaotic interpenetration logic, uneven color filling, and the bamboo weaving images imported during sample introduction are local images, resulting in the false images generated by the machine also being local images, and designers need to subjectively assign values to the images generated by the bamboo weaving patterns based on experience. This is also one of the reasons why designers are required to draw bamboo weaving photos into vector graphics in the early stage. After designers accumulate a considerable amount of bamboo weaving experience, according to the local bamboo weaving pattern images, they can supplement the overall bamboo weaving pattern effect through divergent thinking. By observing and capturing the weaving characteristics of the bamboo weaving generated images, the present invention adopts the common weaving technique of bamboo weaving - the four-way continuous technique, and repeats the captured bamboo weaving pattern characteristics up, down, left, and right to convert the local bamboo weaving generated image into the overall bamboo weaving plan view. This four-way repeating technique has a uniform rhythm, unified rhyme, and strong integrity.
[0052] Step S09: Perform parametric modeling on multiple said vector patterns to establish a parametric model library of bamboo weaving patterns.
[0053] In step S09 of the present invention, the present invention uses the Grasshopper plug-in in Rhino software to perform parametric programming modeling on the bamboo weaving patterns, sort out the logic and relationship of the bamboo weaving interpenetration structure, and finally build a parametric model library of bamboo weaving patterns. The parametric model library of bamboo weaving patterns built in step S09 of the present invention is shown in Figure 10 as follows.
[0054] The process of establishing a parametric model library for bamboo weaving patterns of the present invention includes the following steps: Import the vector diagram of the overall plan view of the bamboo weaving into a preset Grasshopper plug-in to obtain the weaving angle of the overall plan view of the bamboo weaving; Obtain the intersection coordinates of multiple overall plan views of the bamboo weaving based on the width and weaving angle of the bamboo weaving; Obtain multiple intersection curvature values based on the intersection coordinates, and screen out the intersections less than or equal to the bending threshold from the multiple intersection curvature values as target intersections based on a preset bamboo bending threshold; Connect the target intersections to generate a bamboo weaving path, and construct a parametric model library for bamboo weaving patterns based on the bamboo weaving path.
[0055] Specifically, the mathematical expression for obtaining the weaving angle of the overall plan view of the bamboo weaving by importing the vector diagram of the overall plan view of the bamboo weaving into a preset plug-in is shown in formula (8): In the formula where represents the weaving angle of the overall plan view of the bamboo weaving, represents the weft spacing, represents the bamboo weaving thickness, represents the bamboo weaving width.
[0056] Specifically, obtaining the intersection coordinates of multiple overall plan views of the bamboo weaving based on the width and weaving angle of the bamboo weaving can be divided into the following steps: Obtain the warp family based on the weaving angle of the overall plan view of the bamboo weaving, and its mathematical expression is shown in formula (9): In the formula where , , represents the abscissa of the warp family, represents the ordinate of the warp family, represents the number of longitudinal bamboo strips, represents the height of the bamboo weaving, represents the warp spacing, represents the weft spacing, represents the weaving angle of the overall plan view of the bamboo weaving.
[0057] Obtain the weft family based on the weaving angle of the overall plan view of the bamboo weaving, and its mathematical expression is shown in formula (10): In the formula where , .
[0058] Solve the equations of the warp family and the weft family simultaneously, that is , , obtain the intersection coordinates of the overall planar graph of the bamboo weaving, and its mathematical expression is shown in formula (11): In formula , represents the abscissa of the intersection point, represents the ordinate of the intersection point.
[0059] When obtaining multiple intersection curvature values based on the intersection coordinates and screening out the intersection points less than or equal to the bending threshold from the multiple intersection curvature values as the target intersection points, the mathematical expression of the preset bamboo weaving bending threshold is as shown in formula : In formula , represents the preset bamboo weaving bending threshold, represents the minimum bending radius of the bamboo weaving, represents the thickness correction coefficient, represents the thickness of the bamboo weaving.
[0060] The mathematical expression of the screening condition for screening out the intersection points less than or equal to the bending threshold from the multiple intersection curvature values as the target intersection points is as shown in formula : In formula , represents the intersection curvature value.
[0061] Connect the target intersection points to generate a bamboo weaving path. The process of constructing a parametric model library for the bamboo weaving pattern based on the bamboo weaving path includes: smoothly connecting all the intersection points in sequence , and generating a bamboo weaving path.
[0062] Step S10: Obtain a three-dimensional design model of the bamboo weaving object based on the parametric model library of the bamboo weaving pattern and the initial three-dimensional model of the bamboo weaving object.
[0063] In step S10 of the present invention, the present invention starts from Figure 10Select three parametric models of bamboo weaving patterns numbered 1, 2, and 8 from the shown parametric model library of bamboo weaving patterns for parametric modeling. The specific process is as follows: Adjust the dimensions of the initial three-dimensional model of the bamboo weaving object to obtain the initial three-dimensional model of the bamboo weaving object to be processed. After sequentially performing material rendering, lighting rendering, and scene rendering on the initial three-dimensional model of the bamboo weaving object to be processed, export the designed three-dimensional model of the bamboo weaving object. Finally, apply the designed three-dimensional model of the bamboo weaving object to the shape design of a ladies' handbag, and import them into Keyshot software respectively for material, lighting, and scene rendering. The generated renderings are shown in Figures 14 - 16 as shown.
[0064] Please refer to Figures 14 - 16 , in the selection of materials for the ladies' handbag of the present invention, following the design mode of inheritance and innovation, adopting the collision of multiple materials, choosing the traditional combination of bamboo weaving and wood for the main material of the handbag to highlight its natural attributes; the handle and local structural parts are paired with modern materials such as leather and brass metal to increase the fashion avant-garde of the shape and the delicate sense of details. It not only retains the cultural characteristics of traditional bamboo weaving products but also conforms to the requirements of modern lifestyle and aesthetics. The mixing of multiple materials makes the bamboo weaving ladies' handbag highlight the level and beauty in texture, as well as the sense of fashion resulting from the fusion and collision of traditional and modern styles. At the same time, it is also beneficial for the use of the bamboo weaving ladies' handbag in multiple scenarios, expanding the utilization rate of bamboo weaving technology and enhancing the visual impact of the product, bringing a new development direction to the design of bamboo weaving products.
[0065] Embodiment 2 Please refer to Figure 17 , as shown in the structural schematic diagram of a bamboo weaving parameter design system based on a style generator adversarial network proposed in the second embodiment of the present application. The system includes: A data preprocessing module 100, which is used to preprocess the local bamboo weaving patterns and establish a local bamboo weaving pattern data set; A style generator adversarial network module 200, which is used to import the data set into a preset style generator adversarial network model for training, obtain a trained style generator adversarial network model, and input a preset random noise vector into the trained adversarial network model to output multiple local bamboo weaving images; An image quality scoring module 300, which is used to obtain a first image quality score according to the divergence of each local bamboo weaving image, and obtain a second image quality score based on the representation mean of each local bamboo weaving image and the representation mean of a preset real bamboo weaving image; and obtain the total image quality score of each local bamboo weaving image based on the first image quality score and the second image quality score; An image screening module 400, which is configured to determine a target partial bamboo weaving image from the partial bamboo weaving images according to the total image quality score and a preset image quality score threshold; An image superposition module 500, which is configured to perform superposition processing on the target partial bamboo weaving image in the up, down, left, and right directions to obtain vector patterns of multiple overall bamboo weaving floor plans; A parametric modeling module 600, which is configured to perform parametric modeling on the vector patterns to establish a parametric model library of bamboo weaving patterns; A model export module 700, which is configured to determine a parametric model of a bamboo weaving pattern from the parametric model library of bamboo weaving patterns and import it into an initial three-dimensional model of a bamboo object to obtain a designed three-dimensional model of the bamboo object.
[0066] The beneficial effects of a bamboo weaving parameter design system based on a style generator adversarial network proposed in the second embodiment of the present application are as follows: First, by designing a style generator adversarial network module 200, the present invention enables the generator inside the module to learn a large amount of data to study its distribution law, generate a new data distribution, and determine whether the input data is real data or data generated by the generator through a discriminator. Through the mutual game between the generator and the discriminator, the generator tries to generate a sufficiently real data distribution to deceive the discriminator, and the discriminator improves its judgment ability to identify the authenticity of the input data. The two play against each other and perform adversarial training until the Nash equilibrium is finally reached, so that the generated bamboo weaving images can achieve the effect of being indistinguishable from the real ones. Second, the image quality scoring module 300 takes into account the balance between the clarity and restoration degree of the generated bamboo weaving images. Finally, using the model export module 700, several models are randomly selected from the bamboo weaving parametric model library and applied to the design of a lady's handbag, and models of multiple lady's handbags are manually constructed to highlight the level and beauty in the texture of the bamboo woven lady's handbag.
[0067] A bamboo weaving parameter design system based on a style generator adversarial network in an embodiment of the present application can be a device, or a component, an integrated circuit, or a chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a handheld computer, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiment of the present application does not make a specific limitation.
[0068] A bamboo weaving parameter design system based on a style generator adversarial network in an embodiment of the present application can be a device with an operating system. The operating system can be an Android operating system, an iOS operating system, or other operating systems that can be implemented by the bamboo weaving parameter design system against the network. For the sake of avoiding repetition, the various processes implemented by the bamboo weaving parameter design system against the network are not described herein again.
[0069] Optionally, an embodiment of the present application further provides a bamboo weaving parameter design system based on a style generator adversarial network, including a processor, a memory, and a program or instruction stored on the memory and executable on the processor. The program or instruction can be an operating system that can be implemented by the bamboo weaving parameter design system against the network. The embodiment of the present application does not make a specific limitation.
[0070] A bamboo weaving parameter design system based on a style generator adversarial network provided by the embodiment of the present application can implement Figure 1 each process of a bamboo weaving parameter design method based on a style generator adversarial network in the method embodiment, and can achieve the same technical effect. For the sake of avoiding repetition, it is not described herein again.
[0071] An embodiment of the present application further provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the above-mentioned bamboo weaving parameter design method embodiment based on a style generator adversarial network, and can achieve the same technical effect. For the sake of avoiding repetition, it is not described herein again.
[0072] Among them, the processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disc, etc.
[0073] Another embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement each process of the above embodiment of the bamboo weaving parameter design method based on the style generator adversarial network, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0074] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.
[0075] It should be noted that in this article, the term "including", "comprising", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article, or device. Without further limitations, the element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article, or device including that element. In addition, it should be pointed out that the methods and devices in the embodiments of the present application are not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, the features described with reference to certain examples may be combined in other examples.
[0076] Through the description of the above embodiments, those skilled in the art can clearly understand that the methods in the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases, the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc) and includes several instructions to enable a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0077] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them fall within the protection scope of the present application.
Claims
1. A bamboo weaving parameter design method based on a style generator adversarial network, characterized in that Including: Collect and preprocess local bamboo weaving patterns, and establish a local bamboo weaving pattern dataset; Import the dataset into a preset style generator adversarial network model for training to obtain a trained style generator adversarial network model; Input a preset random noise vector into the trained adversarial network model to output multiple local bamboo weaving images; Obtain a first image quality score based on the divergence of each local bamboo weaving image, where the divergence is used to obtain the clarity of the local bamboo weaving image; Based on the representation mean of each local bamboo weaving image and the representation mean of a preset real bamboo weaving image, obtain a second image quality score, where the representation mean is used to obtain the reduction degree of the local bamboo weaving image and the real bamboo weaving image; Based on the first image quality score and the second image quality score, obtain the total image quality score of each local bamboo weaving image; Based on the total image quality score and a preset image quality score threshold, determine multiple target local bamboo weaving images from multiple local bamboo weaving images; Perform superposition processing on each target local bamboo weaving image in the up, down, left, and right directions to obtain a vector pattern of the bamboo weaving overall floor plan corresponding to each target local bamboo weaving image; Perform parametric modeling on multiple vector patterns to establish a bamboo weaving pattern parametric model library; Based on the bamboo weaving pattern parametric model library and the initial three-dimensional model of the bamboo weaving object, obtain a designed three-dimensional model of the bamboo weaving object.
2. The bamboo weaving parameter design method based on a style generator adversarial network according to claim 1, characterized in that The process of collecting and preprocessing bamboo weaving patterns and establishing a bamboo weaving pattern dataset includes: Obtain multiple bamboo weaving pattern samples, sequentially perform manual drawing and data augmentation processing on the bamboo weaving pattern samples to obtain multiple self-drawn images with a vector graph style, divide each self-drawn image into multiple regions of the same size, and then perform horizontal mirror processing and vertical mirror processing on each region simultaneously to obtain mirror self-drawn images, and after combining the mirror self-drawn images, establish a bamboo weaving pattern dataset.
3. A bamboo weaving parameter design method based on a style generator adversarial network according to claim 1, characterized in that, The style generator adversarial network model includes a generator and a discriminator. The generator is jointly composed of a mapping network layer, an affine style transformation layer, and a synthesis network layer. The discriminator is composed of a multi-layer convolutional neural network. Among them, the mapping network layer is composed of multiple serially connected fully connected layers, the affine style transformation layer is composed of multiple serially connected affine transformation layers, and the synthesis network layer is composed of multiple serially connected convolutional layers, upsampling layers, normalization layers, and noise injection layers.
4. A bamboo weaving parameter design method based on a style generator adversarial network according to claim 1, characterized in that, The process of inputting a preset random noise vector into the trained adversarial network model to output multiple local bamboo weaving images includes: Input the preset random noise vector into the mapping network layer in the generator for mapping processing to obtain an intermediate vector; Input the intermediate vector into the affine style transformation layer in the generator for affine transformation processing to obtain a style vector; Input the style vector into the synthesis network layer in the generator to sequentially perform convolution, upsampling, normalization, and noise injection to obtain a bamboo weaving generated image sample; Perform dimensionality reduction on a preset real bamboo weaving image sample to obtain a bamboo weaving real image sample with the same size as the bamboo weaving generated image sample; Input the bamboo weaving real image sample and the bamboo weaving generated image sample into a discriminator inside a trained adversarial network model simultaneously for feature extraction and downsampling processing to obtain multiple local bamboo weaving images.
5. A bamboo weaving parameter design method based on a style generator adversarial network according to claim 1, characterized in that, The mathematical expression for the total quality score of the local bamboo weaving images is: Wherein, is the first image quality score, is the second image quality score, is the total score of the local bamboo weaving image quality, is the probability distribution function, is divergence, is the marginal probability, is the representation mean of the preset real bamboo weaving image, is the representation mean of the local bamboo weaving image, is the trace of the matrix, is the expectation of the local bamboo weaving image in the generated distribution.
6. The bamboo weaving parameter design method based on a style generator adversarial network according to claim 1, characterized in that The process of parametric modeling of multiple vector pattern designs and establishing a parametric model library for bamboo weaving patterns includes: Import the vector map of the overall bamboo weaving floor plan into a preset plug-in to obtain the weaving angle of the overall bamboo weaving floor plan; Obtain the intersection coordinates of multiple overall bamboo weaving floor plans based on the width and weaving angle of the bamboo weaving; Calculate multiple intersection curvature values based on the intersection coordinates, and screen out the intersections with curvature values less than or equal to the preset bamboo weaving bending threshold from the multiple intersection curvature values as target intersections; Connect the target intersections to generate a bamboo weaving path, and construct a parametric model library for bamboo weaving patterns based on the bamboo weaving path.
7. A bamboo weaving parameter design method based on a style generator adversarial network according to claim 1, characterized in that The process of obtaining a designed 3D model of a bamboo weaving object based on the parametric model library of bamboo weaving patterns and the initial 3D model of the bamboo weaving object includes: Adjust the size of the initial 3D model of the bamboo weaving object to obtain an initial 3D model of the bamboo weaving object to be processed, and after performing material rendering, light and shadow rendering, and scene rendering on the initial 3D model of the bamboo weaving object to be processed in sequence, export the designed 3D model of the bamboo weaving object.
8. A bamboo weaving parameter design system based on a style generator adversarial network, characterized in that, The system includes: A data preprocessing module, which is used to preprocess local bamboo weaving patterns and establish a local bamboo weaving pattern dataset; A style generator adversarial network module, which imports the dataset into a preset style generator adversarial network model for training to obtain a trained style generator adversarial network model, and inputs a preset random noise vector into the trained adversarial network model to output multiple local bamboo weaving images; An image quality scoring module, which is used to obtain a first image quality score according to the divergence of each local bamboo weaving image, and obtain a second image quality score based on the representation mean of each local bamboo weaving image and the representation mean of a preset real bamboo weaving image; and obtain the total quality score of each local bamboo weaving image based on the first image quality score and the second image quality score; An image screening module, which is used to determine target local bamboo weaving images from the local bamboo weaving images according to the total quality score of the images and a preset image quality score threshold; An image overlay module, which is used to perform overlay processing on the target local bamboo weaving images in the up, down, left, and right directions to obtain vector pattern designs of multiple overall bamboo weaving floor plans; A parametric modeling module, which is used to perform parametric modeling on the vector pattern designs to establish a parametric model library for bamboo weaving patterns; A model export module, which is used to determine a parametric model of bamboo weaving pattern from the parametric model library of bamboo weaving patterns and import it into the initial three-dimensional model of the bamboo object to obtain a designed three-dimensional model of the bamboo object.
9. An electronic device, characterized in that, It includes a processor, a memory, and programs or instructions stored on the memory and executable on the processor. When the programs or instructions are executed by the processor, the steps of a bamboo weaving parameter design method based on a style generator adversarial network as described in claims 1-7 are implemented.
10. A readable storage medium, characterized in that, Programs or instructions are stored on the readable storage medium. When the programs or instructions are executed by the processor, the steps of a bamboo weaving parameter design method based on a style generator adversarial network as described in claims 1-7 are implemented.